mindspore.ops.Padding

class mindspore.ops.Padding(pad_dim_size=8)[source]

Extends the last dimension of the input tensor from 1 to pad_dim_size, by filling with 0.

Refer to mindspore.ops.padding() for more details.

Supported Platforms:

Ascend GPU CPU

Examples

>>> x = Tensor(np.array([[8], [10]]), mindspore.float32)
>>> pad_dim_size = 4
>>> output = ops.Padding(pad_dim_size)(x)
>>> print(output)
[[ 8.  0.  0.  0.]
 [10.  0.  0.  0.]]