|
11 | 11 | # * Almost the entire tensor (I'm unsure what the point of this comparison is)
|
12 | 12 | # * No windowing (TACO should use a window so we can measure the overhead).
|
13 | 13 | # These options map to the corresponding config values:
|
14 |
| -sizeConfigs = ["constant", "constant-fraction", "almost-whole", "no-windowing"] |
| 14 | +sizeConfigs = ["Constant", "ConstantFraction", "AlmostWhole", "Whole", "NoWindowing"] |
15 | 15 |
|
16 | 16 | def sliceTensor(tensor, dim, config):
|
17 |
| - if config == "constant": |
| 17 | + return tensor |
| 18 | + if config == "Constant": |
18 | 19 | return tensor[250:750, 250:750]
|
19 |
| - elif config == "constant-fraction": |
| 20 | + elif config == "ConstantFraction": |
20 | 21 | size = dim//4
|
21 | 22 | start = dim//4
|
22 | 23 | return tensor[start:(start+size), start:(start+size)]
|
23 |
| - elif config == "almost-whole": |
| 24 | + elif config == "AlmostWhole": |
24 | 25 | 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": |
26 | 29 | return tensor
|
27 | 30 | else:
|
28 | 31 | assert(False)
|
@@ -69,7 +72,7 @@ def bench():
|
69 | 72 | @pytest.mark.parametrize("format", ['csr', 'csc'])
|
70 | 73 | def bench_add_sparse_index_set(tacoBench, dim, format):
|
71 | 74 | indexes = [i * 2 for i in range(0, dim//2)]
|
72 |
| - loader = ScipySparseTensorLoader(format) |
| 75 | + loader = RandomScipySparseTensorLoader(format) |
73 | 76 | matrix = loader.random((dim, dim), 0.01)
|
74 | 77 | def bench():
|
75 | 78 | x = matrix[:, indexes]
|
|
0 commit comments