mindsponge.common.rots_from_tensor
- mindsponge.common.rots_from_tensor(rots, use_numpy=False)[source]
Amortize and split the 3*3 rotation matrix corresponding to the last two axes of input Tensor to obtain each component of the rotation matrix, inverse of 'rots_to_tensor'.
- Parameters
rots (Tensor) – Represent the rotation matrix, shape is \((..., 3, 3)\) .
use_numpy (bool) – Whether to use numpy to calculate. Default:
False
.
- Returns
Tuple, rots represented by vectors, rots is \((xx, xy, xz, yx, yy, yz, zx, zy, zz)\).
- Supported Platforms:
Ascend
GPU
Examples
>>> import numpy as np >>> import mindspore as ms >>> from mindspore import Tensor >>> from mindsponge.common.geometry import rots_from_tensor >>> input_0 = Tensor(np.ones((256, 3, 3)), ms.float32) >>> output = rots_from_tensor(input_0) >>> print(len(output), output[0].shape) 9, (256,)