Skip to content

Commit

Permalink
Attempt fix for array API bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
hameerabbasi committed Nov 28, 2024
1 parent 3c87ca0 commit 4456e41
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sparse/numba_backend/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ def tensordot(a, b, axes=2, *, return_type=None):
ndb = b.ndim
equal = True
if nda == 0 or ndb == 0:
if axes_a == [] and axes_b == []:
if nda == 0 and isinstance(a, SparseArray):
a = a.todense()
if ndb == 0 and isinstance(b, SparseArray):
b = b.todense()
return a * b

Check warning on line 165 in sparse/numba_backend/_common.py

View check run for this annotation

Codecov / codecov/patch

sparse/numba_backend/_common.py#L160-L165

Added lines #L160 - L165 were not covered by tests
pos = int(nda != 0)
raise ValueError(f"Input {pos} operand does not have enough dimensions")
if na != nb:
Expand Down

0 comments on commit 4456e41

Please sign in to comment.