mindspore.ops.TupleToArray

class mindspore.ops.TupleToArray[source]

Converts a tuple to a tensor.

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

Supported Platforms:

Ascend GPU CPU

Examples

>>> input_x = (1,2,3)
>>> print(type(input_x))
<class 'tuple'>
>>> output = ops.TupleToArray()(input_x)
>>> print(type(output))
<class 'mindspore.common.tensor.Tensor'>
>>> print(output)
[1 2 3]