Skip to content

Commit ccc4237

Browse files
author
Rohan Yadav
committed
numpy: adjust windowing benchmark so names are consistent with TACO
1 parent 11de12e commit ccc4237

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

numpy/windowing.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,21 @@
1111
# * Almost the entire tensor (I'm unsure what the point of this comparison is)
1212
# * No windowing (TACO should use a window so we can measure the overhead).
1313
# These options map to the corresponding config values:
14-
sizeConfigs = ["constant", "constant-fraction", "almost-whole", "no-windowing"]
14+
sizeConfigs = ["Constant", "ConstantFraction", "AlmostWhole", "Whole", "NoWindowing"]
1515

1616
def sliceTensor(tensor, dim, config):
17-
if config == "constant":
17+
return tensor
18+
if config == "Constant":
1819
return tensor[250:750, 250:750]
19-
elif config == "constant-fraction":
20+
elif config == "ConstantFraction":
2021
size = dim//4
2122
start = dim//4
2223
return tensor[start:(start+size), start:(start+size)]
23-
elif config == "almost-whole":
24+
elif config == "AlmostWhole":
2425
return tensor[1:(dim-1), 1:(dim-1)]
25-
elif config == "no-windowing":
26+
elif config == "Whole":
27+
return tensor[0:dim, 0:dim]
28+
elif config == "NoWindowing":
2629
return tensor
2730
else:
2831
assert(False)
@@ -69,7 +72,7 @@ def bench():
6972
@pytest.mark.parametrize("format", ['csr', 'csc'])
7073
def bench_add_sparse_index_set(tacoBench, dim, format):
7174
indexes = [i * 2 for i in range(0, dim//2)]
72-
loader = ScipySparseTensorLoader(format)
75+
loader = RandomScipySparseTensorLoader(format)
7376
matrix = loader.random((dim, dim), 0.01)
7477
def bench():
7578
x = matrix[:, indexes]

0 commit comments

Comments
 (0)