mindspore.numpy.array_str

mindspore.numpy.array_str(a)[source]

Returns a string representation of the data in an array.

The data in the array is returned as a single string. This function is similar to array_repr, the difference being that array_repr also returns information on the kind of array and its data type.

Note

Numpy argument max_line_width, precision and suppress_small are not supported. Graph mode dose not support the function.

Parameters

a (Tensor) – Input data.

Returns

String.

Supported Platforms:

Ascend GPU CPU

Raises

TypeError – If input is not tensor.

Examples

>>> import mindspore.numpy as np
>>> x = np.arange(5)
>>> np.array_str(x)
'[0 1 2 3 4]'