mindspore.ops.ScalarCast

class mindspore.ops.ScalarCast[source]

Casts the input scalar to another type.

Refer to mindspore.ops.scalar_cast() for more details.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> from mindspore import ops
>>> scalar_cast = ops.ScalarCast()
>>> output = scalar_cast(255.0, mindspore.int32)
>>> print(output)
255