mindspore/docs/api/api_python/ops/mindspore.ops.func_padding.rst

19 lines
792 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:function:: mindspore.ops.padding(x, pad_dim_size=8)
通过填充0将输入Tensor的最后一个维度从1扩展到指定大小。
参数:
- **x** (Tensor) - `x` 的shape为 :math:`(x_1, x_2, ..., x_R)`秩至少为2它的最后一个维度必须为1。其数据类型为数值型。
- **pad_dim_size** (int) - 要扩展的 `x` 的最后一个维度的值该值必须为正数。默认值8。
返回:
Tensor其数据类型和维度必须和输入中的 `x` 保持一致。
异常:
- **TypeError** - `pad_dim_size` 的数据类型不是int。
- **ValueError** - `pad_dim_size` 的值小于1。
- **ValueError** - `x` 的最后一个维度不等于1。