Skip to content

Commit 649235e

Browse files
committed
Fixing bug in sptensor.__lt__ (<) that led to unnecessary creation of large dense boolean tensors when comparing (sptensor < 0). Closes #15.
1 parent 81ffd82 commit 649235e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

TensorToolbox/sptensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,7 @@ def __lt__(self, other):
18521852
# Case 1: One argument is a scalar
18531853
if isinstance(other, (float, int)):
18541854
subs1 = self.subs[(self.vals < other).transpose()[0], :]
1855-
if other >= 0:
1855+
if other > 0:
18561856
subs2 = self.allsubs()[ttb.tt_setdiff_rows(self.allsubs(), self.subs), :]
18571857
subs = np.vstack((subs1, subs2))
18581858
else:

0 commit comments

Comments
 (0)