mindspore.mint.nn.ReplicationPad3d
- class mindspore.mint.nn.ReplicationPad3d(padding)[source]
Pad the last 3-D dimensions of input tensor using the replication of the input boundary.
For more information, please refer to
mindspore.mint.nn.functional.pad().Warning
This is an experimental API that is subject to change or deletion.
- Parameters
padding (Union[int, tuple, list]) –
Specifies padding size.
If an int, pads all boundaries with the same amount.
If a tuple or list, it should be in the order \((pad_{left}, pad_{right}, pad_{up}, pad_{down}, pad_{front}, pad_{back})\).
- Inputs:
input (Tensor) - The input tensor, with shape \((N, D_{in}, H_{in}, W_{in})\) or \((N, C, D_{in}, H_{in}, W_{in})\).
- Outputs:
Tensor, with shape \((C, H_{out}, W_{out})\) or \((N, C, H_{out}, W_{out})\). Where:
\(D_{out} = D_{in} + pad_{front} + pad_{back}\)
\(H_{out} = H_{in} + pad_{up} + pad_{down}\)
\(W_{out} = W_{in} + pad_{left} + pad_{right}\)
- Supported Platforms:
Ascend
Examples
>>> import mindspore >>> pad3d = mindspore.mint.nn.ReplicationPad3d(1) >>> input = mindspore.tensor(mindspore.mint.arange(0, 9).reshape(1, 1, 1, 3, 3), mindspore.float32) >>> out = pad3d(input) >>> print(out) [[[[[0. 0. 1. 2. 2.] [0. 0. 1. 2. 2.] [3. 3. 4. 5. 5.] [6. 6. 7. 8. 8.] [6. 6. 7. 8. 8.]] [[0. 0. 1. 2. 2.] [0. 0. 1. 2. 2.] [3. 3. 4. 5. 5.] [6. 6. 7. 8. 8.] [6. 6. 7. 8. 8.]] [[0. 0. 1. 2. 2.] [0. 0. 1. 2. 2.] [3. 3. 4. 5. 5.] [6. 6. 7. 8. 8.] [6. 6. 7. 8. 8.]]]]]