MCPcopy
hub / github.com/numpy/numpy / params_1

Function params_1

numpy/random/tests/test_smoke.py:28–58  ·  view source on GitHub ↗
(f, bounded=False)

Source from the content-addressed store, hash-verified

26
27
28def params_1(f, bounded=False):
29 a = 5.0
30 b = np.arange(2.0, 12.0)
31 c = np.arange(2.0, 102.0).reshape((10, 10))
32 d = np.arange(2.0, 1002.0).reshape((10, 10, 10))
33 e = np.array([2.0, 3.0])
34 g = np.arange(2.0, 12.0).reshape((1, 10, 1))
35 if bounded:
36 a = 0.5
37 b = b / (1.5 * b.max())
38 c = c / (1.5 * c.max())
39 d = d / (1.5 * d.max())
40 e = e / (1.5 * e.max())
41 g = g / (1.5 * g.max())
42
43 # Scalar
44 f(a)
45 # Scalar - size
46 f(a, size=(10, 10))
47 # 1d
48 f(b)
49 # 2d
50 f(c)
51 # 3d
52 f(d)
53 # 1d size
54 f(b, size=10)
55 # 2d - size - broadcast
56 f(e, size=(10, 2))
57 # 3d - size
58 f(g, size=(10, 10, 10))
59
60
61def comp_state(state1, state2):

Callers 7

test_standard_gammaMethod · 0.85
test_standard_tMethod · 0.85
test_chisquareMethod · 0.85
test_exponentialMethod · 0.85
test_geometricMethod · 0.85
test_poissonMethod · 0.85
test_rayleighMethod · 0.85

Calls 3

reshapeMethod · 0.80
fFunction · 0.50
maxMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…