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,
.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
is , where X_R is any number. The expanded shape is . If the axis is other value, then expand in the other direction. And return expanded .
- 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]))