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.Cast.rst 605 B

1234567891011121314151617181920
  1. mindspore.ops.Cast
  2. ===================
  3. .. py:class:: mindspore.ops.Cast
  4. 转换输入Tensor的数据类型。
  5. **输入:**
  6. - **input_x** (Union[Tensor, Number]) - 输入要进行数据类型转换的Tensor,其shape为 :math:`(x_1, x_2, ..., x_R)` 。
  7. - **type** (dtype.Number) - 指定转换的数据类型。仅支持常量值。
  8. **输出:**
  9. Tensor,其shape与 `input_x` 相同,即 :math:`(x_1, x_2, ..., x_R)` 。
  10. **异常:**
  11. - **TypeError** - `input_x` 既不是Tensor也不是数值型。
  12. - **TypeError** - `type` 不是数值型。