MCPcopy Index your code
hub / github.com/numpy/numpy / test_broadcast

Method test_broadcast

numpy/lib/tests/test_shape_base.py:111–116  ·  view source on GitHub ↗

Test that non-indexing dimensions are broadcast in both directions

(self)

Source from the content-addressed store, hash-verified

109 assert_equal(i_min, i_max)
110
111 def test_broadcast(self):
112 """ Test that non-indexing dimensions are broadcast in both directions """
113 a = np.ones((3, 4, 1))
114 ai = np.arange(10, dtype=np.intp).reshape((1, 2, 5)) % 4
115 put_along_axis(a, ai, 20, axis=1)
116 assert_equal(take_along_axis(a, ai, axis=1), 20)
117
118 def test_invalid(self):
119 """ Test invalid inputs """

Callers

nothing calls this directly

Calls 4

put_along_axisFunction · 0.90
assert_equalFunction · 0.90
take_along_axisFunction · 0.90
reshapeMethod · 0.80

Tested by

no test coverage detected