mindspore/docs/api/api_python/ops/mindspore.ops.ScalarToTenso...

19 lines
533 B
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.ScalarToTensor
==============================
.. py:class:: mindspore.ops.ScalarToTensor
将Scalar转换为指定数据类型的 `Tensor`
**输入:**
- **input_x** (Union[int, float]) - 输入是Scalar。只能是常量值。
- **dtype** (mindspore.dtype) -指定输出的数据类型。只能是常量值。默认值mindspore.float32。
**输出:**
Tensor0维Tensor其值和输入一致。
**异常:**
- **TypeError** - `input_x` 既不是int也不是float。