array

array(object, dtype=None, ctx=None)

Create an array.

Parameters:
object : array_like or numpy.ndarray or mxnet.numpy.ndarray

An array, any object exposing the array interface, an object whose __array__ method returns an array, or any (nested) sequence.

dtype : data-type, optional

The desired data-type for the array. Default is float32.

ctx : device context, optional

Device context on which the memory is allocated. Default is mxnet.context.current_context().

Returns:
out : ndarray

An array object satisfying the specified requirements.

Examples

>>> np.array([1, 2, 3])
array([1., 2., 3.])
>>> np.array([[1, 2], [3, 4]])
array([[1., 2.],
       [3., 4.]])
>>> np.array([[1, 0], [0, 1]], dtype=bool)
array([[ True, False],
       [False,  True]])