Table Of Contents
Table Of Contents

RowSparseNDArray.__getitem__

RowSparseNDArray.__getitem__(key)[source]

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

Returns a sliced view of this array.

Parameters:key (slice) – Indexing key.

Examples

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