mindsponge.common.rots_to_tensor
================================

.. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.2/resource/_static/logo_source.svg
    :target: https://gitee.com/mindspore/mindscience/blob/r0.5/MindSPONGE/docs/api/api_python/common/mindsponge.common.rots_to_tensor.rst
    :alt: 查看源文件


.. py:function:: mindsponge.common.rots_to_tensor(rots, use_numpy=False)

    将以向量表示的旋转矩阵转化为tensor, `rots_from_tensor` 的逆操作。

    参数:
        - **rots** (Tuple) - 使用向量表示的旋转矩阵, :math:`(xx, xy, xz, yx, yy, yz, zx, zy, zz)`。
        - **use_numpy** (bool) - 是否使用numpy计算,默认值: ``False``。

    返回:
        tensor,最后一根轴合并后的旋转矩阵,shape为 :math:`(N_{res}, 3, 3)`。