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

Function test_broadcast_to_raises

numpy/lib/tests/test_stride_tricks.py:268–284  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

266
267
268def test_broadcast_to_raises():
269 data = [
270 [(0,), ()],
271 [(1,), ()],
272 [(3,), ()],
273 [(3,), (1,)],
274 [(3,), (2,)],
275 [(3,), (4,)],
276 [(1, 2), (2, 1)],
277 [(1, 1), (1,)],
278 [(1,), -1],
279 [(1,), (-1,)],
280 [(1, 2), (-1, 2)],
281 ]
282 for orig_shape, target_shape in data:
283 arr = np.zeros(orig_shape)
284 assert_raises(ValueError, lambda: broadcast_to(arr, target_shape))
285
286
287def test_broadcast_shape():

Callers

nothing calls this directly

Calls 2

assert_raisesFunction · 0.90
broadcast_toFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…