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

Method test_kron_shape

numpy/lib/tests/test_shape_base.py:742–751  ·  view source on GitHub ↗
(self, shape_a, shape_b)

Source from the content-addressed store, hash-verified

740 ((2, 0, 0, 2), (2, 0, 2)),
741 ])
742 def test_kron_shape(self, shape_a, shape_b):
743 a = np.ones(shape_a)
744 b = np.ones(shape_b)
745 normalised_shape_a = (1,) * max(0, len(shape_b) - len(shape_a)) + shape_a
746 normalised_shape_b = (1,) * max(0, len(shape_a) - len(shape_b)) + shape_b
747 expected_shape = np.multiply(normalised_shape_a, normalised_shape_b)
748
749 k = np.kron(a, b)
750 assert np.array_equal(
751 k.shape, expected_shape), "Unexpected shape from kron"
752
753
754class TestTile:

Callers

nothing calls this directly

Calls 1

maxFunction · 0.50

Tested by

no test coverage detected