You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.ops.ScalarToTensor.rst 534 B

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