public struct ZeroPadding2D<Scalar> : ParameterlessLayer where Scalar : TensorFlowFloatingPoint

A layer for adding zero-padding in the spatial dimensions.

  • The padding values along the spatial dimensions.

    Declaration

    @noDerivative
    public let padding: ((Int, Int), (Int, Int))
  • Creates a zero-padding 2D Layer.

    Declaration

    public init(padding: ((Int, Int), (Int, Int)))

    Parameters

    padding

    A tuple of 2 tuples of two integers describing how many zeros to be padded at the beginning and end of each padding dimensions.

  • Creates a zero-padding 2D Layer.

    Declaration

    public init(padding: (Int, Int))

    Parameters

    padding

    Tuple of 2 integers that describes how many zeros to be padded at the beginning and end of each padding dimensions.

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

    Declaration

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

    Parameters

    input

    The input to the layer.

    Return Value

    The output.