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

Function assert_shapes_correct

numpy/lib/tests/test_stride_tricks.py:22–30  ·  view source on GitHub ↗
(input_shapes, expected_shape)

Source from the content-addressed store, hash-verified

20
21
22def assert_shapes_correct(input_shapes, expected_shape):
23 # Broadcast a list of arrays with the given input shapes and check the
24 # common output shape.
25
26 inarrays = [np.zeros(s) for s in input_shapes]
27 outarrays = broadcast_arrays(*inarrays)
28 outshapes = [a.shape for a in outarrays]
29 expected = [expected_shape] * len(inarrays)
30 assert_equal(outshapes, expected)
31
32
33def assert_incompatible_shapes_raise(input_shapes):

Calls 2

broadcast_arraysFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…