mindspore2022/docs/api/api_python/ops/mindspore.ops.Padding.rst

24 lines
800 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.Padding
=====================
.. py:class:: mindspore.ops.Padding(pad_dim_size=8)
将输入Tensor的最后一个维度从1扩展到 `pad_dim_size` 其填充值为0。
**参数:**
- **pad_dim_size** (int) - 指定填充的大小,待扩展的 `x` 的最后一个维度的值必须为正数。默认值8。
**输入:**
- **x** (Tensor) - 输入Tensor其shape为 :math:`(x_1, x_2, ..., x_R)``x` 的秩必须至少为2。 `x` 的最后一个维度必须为1。数据类型为Number。
**输出:**
Tensor其shape是 :math:`(z_1, z_2, ..., z_N)`
**异常:**
- **TypeError** - `pad_dim_size` 不是int。
- **ValueError** - `pad_dim_size` 小于1。
- **ValueError** - `x` 的最后一个维度不等于1。