Padding Layers

Padding Layers#

Spatial padding operations with various boundary conditions. Supports reflection, replication, zero, constant value, and circular padding for 1D, 2D, and 3D inputs. Essential for controlling output sizes in convolutional networks and handling edge effects.

ReflectionPad1d

Pads the input tensor using the reflection of the input boundary.

ReflectionPad2d

Pads the input tensor using the reflection of the input boundary.

ReflectionPad3d

Pads the input tensor using the reflection of the input boundary.

ReplicationPad1d

Pads the input tensor using replication of the input boundary.

ReplicationPad2d

Pads the input tensor using replication of the input boundary.

ReplicationPad3d

Pads the input tensor using replication of the input boundary.

ZeroPad1d

Pads the input tensor with zeros.

ZeroPad2d

Pads the input tensor with zeros.

ZeroPad3d

Pads the input tensor with zeros.

ConstantPad1d

Pads the input tensor with a constant value.

ConstantPad2d

Pads the input tensor with a constant value.

ConstantPad3d

Pads the input tensor with a constant value.

CircularPad1d

Pads the input tensor using circular padding (wrap around).

CircularPad2d

Pads the input tensor using circular padding (wrap around).

CircularPad3d

Pads the input tensor using circular padding (wrap around).