I proposed that we remove sptensor.extract, as the sptensor.__getitem__ functionality should support all of the use cases that we need. Although we proposed to remove sptensor.extract in #160, it is still being used.
Here are the steps that need to be addressed:
[ ] Replace use of sptensor.extract with use of sptensor.__getitem__. Note that the output of extract for sparse tensors with 1 nonzero returns numpy.ndarray, whereas __getitem__ was recently changed to return a scalar in this case.
[ ] Replace use of sptensor.extract in sptensor.__getitem__.
The way that the MATLAB TTB sptensor accessor analog to __getitem__ (i.e., subsref) works is to allow users to include an additional input parameter, 'extract' to extract the result as a vector. I think we should stick with the more numpy-like approach and post process the output of __getitem__ when needed.
I proposed that we remove
sptensor.extract
, as thesptensor.__getitem__
functionality should support all of the use cases that we need. Although we proposed to removesptensor.extract
in #160, it is still being used.Here are the steps that need to be addressed:
sptensor.extract
with use ofsptensor.__getitem__
. Note that the output ofextract
for sparse tensors with 1 nonzero returnsnumpy.ndarray
, whereas__getitem__
was recently changed to return a scalar in this case.sptensor.extract
insptensor.__getitem__
.The way that the MATLAB TTB
sptensor
accessor analog to__getitem__
(i.e.,subsref
) works is to allow users to include an additional input parameter,'extract'
to extract the result as a vector. I think we should stick with the morenumpy
-like approach and post process the output of__getitem__
when needed.