Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fferflo committed Jun 26, 2024
1 parent 1953100 commit a14c93b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/test_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,21 @@ def w(shape):
v = setup.full((2, 4, 100))
with pytest.raises(Exception):
einx.dot("b t (h ck), b t (h cv) -> b h ck cv", k, v, h=32, graph=True)

x = setup.full((10, 20))
y = setup.full((10, 24))
z = setup.full((3, 24))
assert einx.dot("[a] b, [a c], d [c] -> b d", x, y, z).shape == (20, 3)
assert einx.dot("a b, a c, d c -> b d", x, y, z).shape == (20, 3)


x = setup.full((10, 20, 24))
y = setup.full((10, 24))
z = setup.full((3, 24))
assert einx.dot("[a] b [c], [a c], d [c] -> b d", x, y, z).shape == (20, 3)
assert einx.dot("a b c, a c, d c -> b d", x, y, z).shape == (20, 3)
with pytest.raises(Exception):
einx.dot("[a] b [c], a c, d [c] -> b d", x, y, z)

@pytest.mark.parametrize("test", conftest.tests)
def test_shape_reduce(test):
einx, backend, setup = test
Expand Down

0 comments on commit a14c93b

Please sign in to comment.