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

31 lines
1.6 KiB
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.Tile
===================
.. py:class:: mindspore.ops.Tile()
按照给定的次数复制输入Tensor。
通过复制 `multiples``input_x` 来创建新的Tensor。输出Tensor的第i维度有 `input_x.shape[i] * multiples[i]` 个元素,并且 `input_x` 的值沿第i维度被复制 `multiples[i]` 次。
.. note::
`multiples` 的长度必须大于或等于 `input_x` 的维度。
**输入:**
- **input_x** (Tensor) - 1-D或更高维的Tensor。
- **multiples** (tuple[int]) - 指定复制次数的参数参数类型为tuple数据类型为整数。如 :math:`(y_1, y_2, ..., y_S)``multiples` 的长度不能小于 `input_x` 的维度。只支持常量值。
**输出:**
Tensor具有与 `input_x` 相同的数据类型。假设 `multiples` 的长度为 `d` `input_x` 的维度为 `input_x.dim` `input_x` 的shape为 :math:`(x_1, x_2, ..., x_S)`
- 如果 `input_x.dim = d` 将其相应位置的shape相乘输出的shape为 :math:`(x_1*y_1, x_2*y_2, ..., x_S*y_S)`
- 如果 `input_x.dim < d` `input_x` 的shape的前面填充1直到它们的长度一致。例如将 `input_x` 的shape设置为 :math:`(1, ..., x_1, ..., x_R, x_S)` 然后可以将其相应位置的shape相乘输出的shape为 :math:`(1*y_1, ..., x_R*y_R, x_S*y_S)`
**异常:**
- **TypeError** - `multiples` 不是tuple或者其元素并非全部是int。
- **ValueError** - `multiples` 的元素并非全部大于0。
- **ValueError** - `multiples` 的长度小于 `input_x` 中的维度。