mindsponge.common.vecs_expand_dims
- mindsponge.common.vecs_expand_dims(v, axis)[source]
Add an extra dimension to the input v at the given axis.
- Parameters
v (Tuple) – Input vector. Length is 3, \((xx, xy, xz)\) .
axis (int) – Specifies the dimension index at which to expand the shape of v. Only constant value is allowed.
- Returns
- Tuple, if the axis is 0, and the shape of \(xx\) is \((..., X_R)\), where X_R is any number.
The expanded shape is \((1, ..., X_R)\). If the axis is other value, then expand in the other direction. And return expanded \((xx, xy, xz, yx, yy, yz, zx, zy, zz)\) .
- Supported Platforms:
Ascend
GPU
Examples
>>> from mindsponge.common.geometry import vecs_expand_dims >>> from mindspore.common import Tensor >>> from mindspore import dtype as mstype >>> v = (1, 2, 3) >>> axis = 0 >>> output= vecs_expand_dims(v, axis) >>> print(output) (Tensor(shape=[1], dtype=Int64, value=[1]),Tensor(shape=[1], dtype=Int64, value=[2]), Tensor(shape=[1], dtype=Int64, value=[3]))