Skip to content

Commit 0620974

Browse files
author
Olivia W Hsu
committed
Add in debug statements and also make sure values are cenetered around 0 for minmax
1 parent 2976700 commit 0620974

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

numpy/minmax.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def bench():
2222
else:
2323
reduced = np.min(reduced, -1)
2424
return reduced
25-
tacoBench(bench)
25+
red = tacoBench(bench)
26+
print("reduced value for", dims, "is", red)
2627

2728
@pytest.mark.parametrize("dims", [1, 3, 5])
2829
def bench_minmax_statistics(tacoBench, dims):

numpy/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ def tensor(self, shape, variant=None):
504504
stop = numpy.max(ind_list)
505505
for i in range(start, stop):
506506
temp = tuple(c[1:] + [i])
507-
values[temp] = int(20*numpy.random.rand())
507+
values[temp] = int(20*numpy.random.rand() - 10)
508508

509509
dok = sparse.DOK(shape, values)
510510
ind = tuple([e - 1 for e in shape])

taco/minimax.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ static void bench_minimax(benchmark::State& state) {
9191
// std::cout << result.getSource() << std::endl;
9292
state.ResumeTiming();
9393
result.compute();
94+
// state.PauseTiming();
95+
// cout << "Reduced value" << result << endl;
9496
}
9597
}
9698
TACO_BENCH(bench_minimax);

0 commit comments

Comments
 (0)