mindsponge.common.rots_scale
- mindsponge.common.rots_scale(rot, scale)[源代码]
对旋转矩阵进行缩放。
\[\begin{split}\begin{split} &rot=(xx,xy,xz,yx,yy,yz,zx,zy,zz) \\ &scaled\_{rots} = (scale*xx,scale*xy,scale*xz,scale*yx,scale*yy,scale*yz,scale*zx,scale*zy,scale*zz) \end{split}\end{split}\]- 参数:
rot (Tuple) - 旋转矩阵,tuple长度为9,\((xx,xy,xz,yx,yy,yz,zx,zy,zz)\),其中每个元素是标量或者Tensor。 若为Tensor其shape相同。
scale (float) - 缩放值。
- 返回:
scaled_rots (Tuple) -缩放后的旋转矩阵,tuple长度为9,shape与rot相同。
- 支持平台:
Ascend
GPU
CPU
样例:
>>> import numpy as np >>> from mindspore import Tensor >>> from mindspore import dtype as mstype >>> from mindsponge.common.geometry import rots_scale >>> x = Tensor(np.ones(256), mstype.float32) >>> result = rots_scale((x, x, x, x, x, x, x, x, x),10) >>> print(len(result)) >>> print(result[0].shape) >>> print(result[1].shape) >>> print(result[2].shape) >>> print(result[3].shape) >>> print(result[4].shape) >>> print(result[5].shape) >>> print(result[6].shape) >>> print(result[7].shape) >>> print(result[8].shape) 3 (256,) (256,) (256,) (256,) (256,) (256,) (256,) (256,) (256,)