MCPcopy Create free account
hub / github.com/numpy/numpy / ArgParsingReduce

Class ArgParsingReduce

benchmarks/benchmarks/bench_ufunc.py:476–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

474
475
476class ArgParsingReduce(Benchmark):
477 # In order to benchmark the speed of argument parsing, all but the
478 # out arguments are chosen such that they have minimal effect on the
479 # calculation.
480 a = np.arange(2.)
481 out = np.array(0.)
482 param_names = ['arg_kwarg']
483 params = [[
484 ArgPack(a,),
485 ArgPack(a, 0),
486 ArgPack(a, axis=0),
487 ArgPack(a, 0, None),
488 ArgPack(a, axis=0, dtype=None),
489 ArgPack(a, 0, None, out),
490 ArgPack(a, axis=0, dtype=None, out=out),
491 ArgPack(a, out=out)
492 ]]
493
494 def time_add_reduce_arg_parsing(self, arg_pack):
495 np.add.reduce(*arg_pack.args, **arg_pack.kwargs)
496
497class BinaryBench(Benchmark):
498 def setup(self):

Callers

nothing calls this directly

Calls 1

ArgPackClass · 0.85

Tested by

no test coverage detected