ReplicationPad3d#
- class brainstate.nn.ReplicationPad3d(padding, in_size=None, name=None)[source]#
Pads the input tensor using replication of the input boundary.
- Parameters:
padding (
int|Sequence[int]) –The size of the padding. Can be:
int: same padding for all sides
Sequence[int] of length 3: (depth_pad, height_pad, width_pad)
Sequence[int] of length 6: (left, right, top, bottom, front, back)
in_size (
int|Sequence[int] |integer|Sequence[integer] |None) – The input size.
Examples
>>> import brainstate as brainstate >>> import jax.numpy as jnp >>> pad = brainstate.nn.ReplicationPad3d(1) >>> input = jnp.ones((1, 4, 4, 4, 3)) >>> output = pad(input) >>> print(output.shape) (1, 6, 6, 6, 3)