220 Star 933 Fork 688

GVPMindSpore/mindscience

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
sciai.utils.to_tensor.rst 555 Bytes
一键复制 编辑 原始数据 按行查看 历史
ZhihaoLi 提交于 2年前 . [SciAI][docs] fix docs

sciai.utils.to_tensor

.. py:function:: sciai.utils.to_tensor(tensors, dtype=ms.float32)

    将数组/张量转换为给定的MindSpore数据类型。

    参数:
        - **tensors** (Union[Tensor, ndarray, Number, np.floating, tuple[Tensor, ndarray]]) - 要转换的若干Tensor。
        - **dtype** (type) - 目标Mindspore Tensor数据类型。 默认值:ms.float32。

    返回:
        Union(Tensor, tuple(Tensor)) - 单个或元组张量。

    异常:
        - **TypeError** 如果输入类型不正确。
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mindspore/mindscience.git
git@gitee.com:mindspore/mindscience.git
mindspore
mindscience
mindscience
r0.5

搜索帮助