Skip to content

Commit 74cb340

Browse files
committed
numpy: add incomplete test for ufuncs on FROSTT tensors
1 parent 639eafc commit 74cb340

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

numpy/ufuncs.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from scipy.sparse import random, csr_matrix
33
import sparse
44
import pytest
5-
from util import TensorCollectionFROSTT
5+
from util import TensorCollectionFROSTT, PydataTensorShifter
66

77
# TODO (rohany): Ask hameer about this. pydata/sparse isn't happy when
88
# given this ufunc to evaluate.
@@ -89,14 +89,13 @@ def bench():
8989

9090
# Run benchmarks against the FROSTT collection.
9191
FROSTTTensors = TensorCollectionFROSTT()
92-
@pytest.mark.skip(reason="way too slow")
9392
@pytest.mark.parametrize("tensor", FROSTTTensors.getTensors(), ids=FROSTTTensors.getTensorNames())
9493
def bench_pydata_frostt_ufunc_sparse(tacoBench, tensor):
9594
frTensor = tensor.load()
96-
# TODO (rohany): Replace this with a call to the random generator.
97-
other = sparse.random(frTensor.shape, density=0.001)
95+
shifter = PydataTensorShifter()
96+
other = shifter.shiftLastMode(frTensor).astype('int64')
9897
def bench():
99-
print("Beginning ldexp")
98+
# TODO (rohany): Expand this test beyond ldexp.
10099
c = numpy.ldexp(frTensor, other)
101100
return c
102101
tacoBench(bench)

0 commit comments

Comments
 (0)