Lambda

public struct Lambda<Inputs, Outputs, Element, Device> : LayerType where Element : NumericType, Device : DeviceType

Layer wrapping an arbitrary transform provided by a closure.

  • Declaration

    Swift

    public var parameterPaths: [WritableKeyPath<`Self`, Tensor<Element, Device>>] { get }
  • Declaration

    Swift

    public var parameters: [Tensor<Element, Device>] { get }
  • Transformation performed by the layer

    Declaration

    Swift

    public var transform: (Inputs) -> Outputs
  • Creates a layer that performs the given transformation on its inputs

    Declaration

    Swift

    public init(_ transform: @escaping (Inputs) -> Outputs)

    Parameters

    transform

    Transformation to perform

  • Declaration

    Swift

    public func callAsFunction(_ inputs: Inputs) -> Outputs