mindspore/docs/api/api_python/numpy/mindspore.numpy.expand_dims...

17 lines
625 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.numpy.expand_dims
=================================
.. py:function:: mindspore.numpy.expand_dims(a, axis)
扩展Tensor的shape。在扩展后的Tensor的shape中插入一个新轴该轴将出现在指定的位置。
参数:
- **a** (Tensor) - 输入Tensor数组。
- **axis** (Union[int, list(int), tuple(int)]) - 新轴在扩展轴中的位置。
返回:
Tensor指定轴位置的维度数增加后的Tensor。
异常:
- **TypeError** - 如果输入参数非上述给定的类型。
- **ValueError** - 如果 ``axis`` 超出了 ``a.ndim``