mindsponge.common.rots_to_tensor
- mindsponge.common.rots_to_tensor(rots, use_numpy=False)[source]
Translate rots represented by vectors to tensor, inverse of ‘rots_from_tensor’.
- Parameters
rots (Tuple) – Rots represented by vectors, shape is \((xx, xy, xz, yx, yy, yz, zx, zy, zz)\) .
use_numpy (bool) – Whether to use numpy to calculate. Default:
False
.
- Returns
Tensor, concat the tensor in last dims, shape \((N_{res}, 3, 3)\).
- Supported Platforms:
Ascend
GPU
Examples
>>> import numpy as np >>> import mindspore as ms >>> from mindspore import Tensor >>> from mindsponge.common.geometry import rots_to_tensor >>> inputs = [Tensor(np.ones((256,)), ms.float32) for i in range(9)] >>> output = rots_to_tensor(inputs) >>> print(output.shape) (256, 3, 3)