mindspore2022/docs/api/api_python/ops/mindspore.ops.repeat_elemen...

16 lines
664 B
ReStructuredText
Raw 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.repeat_elements
===============================
.. py:function:: mindspore.ops.repeat_elements(x, rep, axis=0)
根据指定轴复制输入Tensor的元素类似np.repeat的功能。
**参数:**
- **x** (Tensor) - 输入Tensor。类型为float16、float32、int8、uint8、int16、int32或int64。
- **rep** (int) - 指定复制次数,为正数。
- **axis** (int) - 指定复制轴默认为0。
**输出:**
Tensor值沿指定轴复制。如果 `x` 的shape为 :math:`(s1, s2, ..., sn)` 轴为i则输出的shape为 :math:`(s1, s2, ..., si * rep, ..., sn)` 。输出的数据类型与 `x` 相同。