Reshape

@frozen
public struct Reshape<Scalar> : ParameterlessLayer where Scalar : TensorFlowFloatingPoint

A reshape layer.

  • Declaration

    public typealias TangentVector = EmptyTangentVector
  • The target shape.

    Declaration

    @noDerivative
    public var shape: Tensor<Int32>
  • Creates a reshape layer.

    Declaration

    public init(shape: Tensor<Int32>)

    Parameters

    shape

    The target shape, represented by a tensor.

  • Creates a reshape layer.

    Declaration

    public init(_ shape: TensorShape)

    Parameters

    shape

    The target shape.

  • Returns the output obtained from applying the layer to the given input.

    Declaration

    @differentiable
    public func forward(_ input: Tensor<Scalar>) -> Tensor<Scalar>

    Parameters

    input

    The input to the layer.

    Return Value

    The output.