mindspore.ops.ScalarToArray

class mindspore.ops.ScalarToArray[source]

Converts a scalar to a Tensor.

Refer to mindspore.ops.scalar_to_array() for more detail.

Supported Platforms:

Ascend GPU CPU

Examples

>>> op = ops.ScalarToArray()
>>> input_x = 1.0
>>> print(type(input_x))
<class 'float'>
>>> output = op(input_x)
>>> print(type(output))
<class 'mindspore.common.tensor.Tensor'>
>>> print(output)
1.0