Reshape

public struct Reshape<Element, Device> : LayerType, Codable where Element : NumericType, Device : DeviceType

Layer that reshapes its inputs to a given target size, except the batch size

  • Declaration

    Swift

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

    Swift

    public var parameters: [Tensor<Element, Device>] { get }
  • Target size (except batch size)

    Declaration

    Swift

    public var outputShape: [Int]
  • Layer that reshapes its inputs to a given target size, except the batch size

    Declaration

    Swift

    public init(outputShape: [Int])

    Parameters

    outputShape

    Target size (except batch size)

  • Declaration

    Swift

    public func callAsFunction(_ inputs: Tensor<Element, Device>) -> Tensor<Element, Device>