Skip to content

Commit

Permalink
BENCH: fix bench_reduce.py and bench_shape_base.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rgommers committed Aug 27, 2023
1 parent f8bab52 commit 2cdbc42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions benchmarks/benchmarks/bench_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,11 @@ def time_any_slow(self):


class StatsReductions(Benchmark):
# Not testing, but in array_api (redundant)
# 8, 16, 32 bit variants, and 128 complexes
params = ['int64', 'uint64', 'float64', 'intp',
'complex64', 'bool', 'float', 'int',
'complex', 'complex256'],
params = ['int64', 'uint64', 'float32', 'float64', 'complex64', 'bool_'],
param_names = ['dtype']

def setup(self, dtype):
try:
self.data = np.ones(200, dtype=getattr(np, dtype))
except AttributeError: # builtins throw AttributeError after 1.20
self.data = np.ones(200, dtype=dtype)
self.data = np.ones(200, dtype=dtype)
if dtype.startswith('complex'):
self.data = self.data * self.data.T*1j

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarks/bench_shape_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def time_no_lists(self, n):


class Block2D(Benchmark):
params = [[(16, 16), (32, 32), (64, 64), (128, 128), (256, 256), (512, 512), (1024, 1024)],
params = [[(16, 16), (64, 64), (256, 256), (1024, 1024)],
['uint8', 'uint16', 'uint32', 'uint64'],
[(2, 2), (4, 4)]]
param_names = ['shape', 'dtype', 'n_chunks']
Expand Down

0 comments on commit 2cdbc42

Please sign in to comment.