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

Method test_kron_shape

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

Source from the content-addressed store, hash-verified

711 ((2, 0, 0, 2), (2, 0, 2)),
712 ])
713 def test_kron_shape(self, shape_a, shape_b):
714 a = np.ones(shape_a)
715 b = np.ones(shape_b)
716 normalised_shape_a = (1,) * max(0, len(shape_b)-len(shape_a)) + shape_a
717 normalised_shape_b = (1,) * max(0, len(shape_a)-len(shape_b)) + shape_b
718 expected_shape = np.multiply(normalised_shape_a, normalised_shape_b)
719
720 k = np.kron(a, b)
721 assert np.array_equal(
722 k.shape, expected_shape), "Unexpected shape from kron"
723
724
725class TestTile:

Callers

nothing calls this directly

Calls 1

maxFunction · 0.50

Tested by

no test coverage detected