mindsponge.common.rots_expand_dims

View Source On Gitee
mindsponge.common.rots_expand_dims(rots, axis)[source]

Adds an additional dimension to rots at the given axis.

Parameters
  • rots (Tuple) – The rotation matrix is \((xx, xy, xz, yx, yy, yz, zx, zy, zz)\), and xx and xy have the same shape

  • axis (Int) – Specifies the dimension index at which to expand the shape of v. Only constant value is allowed.

Returns

Tuple, rots. If the value of axis is 0, and the shape of xx is \((..., X_R)\), where \(X_R\) is any number, and the expanded shape is \((1, ..., X_R)\). Return expanded \((xx, xy, xz, yx, yy, yz, zx, zy, zz)\).

Supported Platforms:

Ascend GPU

Examples

>>> from mindsponge.common.geometry import rots_expand_dims
>>> from mindspore.common import Tensor
>>> from mindspore import dtype as mstype
>>> rots = (1, 2, 3, 4, 5, 6, 7, 8, 9)
>>> axis = 0
>>> rots_expand_dims(rots, axis)
>>> print(output)
(Tensor(shape=[1], dtype=Int64, value=[1]), Tensor(shape=[1], dtype=Int64, value=[2]),
Tensor(shape=[1], dtype=Int64, value=[3]), Tensor(shape=[1], dtype=Int64, value=[4]),
Tensor(shape=[1], dtype=Int64, value=[5]), Tensor(shape=[1], dtype=Int64, value=[6]),
Tensor(shape=[1], dtype=Int64, value=[7]), Tensor(shape=[1], dtype=Int64, value=[8]),
Tensor(shape=[1], dtype=Int64, value=[9]))