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

Function assert_shapes_correct

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

Source from the content-addressed store, hash-verified

12
13
14def assert_shapes_correct(input_shapes, expected_shape):
15 # Broadcast a list of arrays with the given input shapes and check the
16 # common output shape.
17
18 inarrays = [np.zeros(s) for s in input_shapes]
19 outarrays = broadcast_arrays(*inarrays)
20 outshapes = [a.shape for a in outarrays]
21 expected = [expected_shape] * len(inarrays)
22 assert_equal(outshapes, expected)
23
24
25def assert_incompatible_shapes_raise(input_shapes):

Calls 2

broadcast_arraysFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected