einx.errors.SemanticError

Contents

einx.errors.SemanticError#

exception einx.errors.SemanticError(message, invocation=None, pos=None)#

This error occurs if the expression requirements of a particular einx operation are not met.

Example

>>> x = np.random.rand(3, 4)
>>> y = np.random.rand(4, 5)
>>> einx.dot("a [b], [c] d -> a d", x, y)
einx.errors.SemanticError: All contracted axes must appear in exactly two input expressions.
Expression: "a [b], [c] d -> a d"
                ^    ^
The operation was called with the following arguments:
- Positional argument #1: Tensor with shape (3, 4)
- Positional argument #2: Tensor with shape (4, 5)