def test_sparse_getitem_one_dim_slice(): actual = dense[2:4] res = sparse_getitem(sparse, slice(2, 4)) assert torch.equal(actual, res.to_dense())