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

Method setup

benchmarks/benchmarks/bench_linalg.py:79–95  ·  view source on GitHub ↗
(self, op, typename)

Source from the content-addressed store, hash-verified

77 param_names = ['op', 'type']
78
79 def setup(self, op, typename):
80 np.seterr(all='ignore')
81
82 self.func = getattr(np.linalg, op)
83
84 if op == 'cholesky':
85 # we need a positive definite
86 self.a = np.dot(get_squares_()[typename],
87 get_squares_()[typename].T)
88 else:
89 self.a = get_squares_()[typename]
90
91 # check that dtype is supported at all
92 try:
93 self.func(self.a[:2, :2])
94 except TypeError as e:
95 raise NotImplementedError() from e
96
97 def time_op(self, op, typename):
98 self.func(self.a)

Callers

nothing calls this directly

Calls 3

get_squares_Function · 0.85
dotMethod · 0.80
funcMethod · 0.45

Tested by

no test coverage detected