Table Of Contents
Table Of Contents

NDArray.copy

NDArray.copy()[source]

Makes a copy of this NDArray, keeping the same context.

Returns:The copied array
Return type:NDArray, CSRNDArray or RowSparseNDArray

Examples

>>> x = mx.nd.ones((2,3))
>>> y = x.copy()
>>> y.asnumpy()
array([[ 1.,  1.,  1.],
       [ 1.,  1.,  1.]], dtype=float32)