Avatar
S4TF内にこんなのがあるんですがこういうのもVariadic Genericsで対応してほしいところ。 (元トピック読んでないのでこういうパターンが議論されてるかは知らない) @differentiable func sequenced<L1: Layer, L2: Layer, L3: Layer, L4: Layer, L5: Layer, L6: Layer>( through l1: L1, _ l2: L2, _ l3: L3, _ l4: L4, _ l5: L5, _ l6: L6 ) -> L6.Output where L1.Input == Self, L1.Output == L2.Input, L2.Output == L3.Input, L3.Output == L4.Input, L4.Output == L5.Input, L5.Output == L6.Input https://github.com/tensorflow/swift-apis/blob/2cab4dba9889c354c941234f990e1bbab0ca5e5c/Sources/TensorFlow/Layer.swift#L210-L215
Swift for TensorFlow Deep Learning Library. Contribute to tensorflow/swift-apis development by creating an account on GitHub.