Table Of Contents
Table Of Contents

mxnet.ndarray.sparse.RowSparseNDArray.__getitem__

RowSparseNDArray.__getitem__(key)[source]

x.__getitem__(i) <=> x[i]

Returns a sliced view of this array.

Parameters

key (mxnet.ndarray.NDArray.slice) – Indexing key.

Examples

>>> x = mx.nd.sparse.zeros('row_sparse', (2, 3))
>>> x[:].asnumpy()
array([[ 0.,  0.,  0.],
       [ 0.,  0.,  0.]], dtype=float32)