einx.dot

Contents

einx.dot#

einx.dot(description, *tensors, backend=None, **parameters)[source]#

Compute the dot-product of values in the given tensors.

In the simplest case, the elementary operation has the signature [a], [a] -> [] and computes the dot-product over the two input vectors. If more than two tensors or more than two axes are passed to the elementary operation, the dot-product is applied sequentially in an unspecified order to all pairs of dimensions with the same name.

If there are no brackets in the expression, brackets are placed implicitly around all axes that do not appear in the output expression. For example, the following operations compute the same output:

z = einx.dot("a b, b c -> a c", x, y)
z = einx.dot("a [b], [b] c -> a c", x, y)
Parameters:
  • description (str) – Description string for the operation in einx notation.

  • *tensors (Tensor) – Input tensors or tensor factories matching the description string.

  • backend (Union[Backend, str, None]) – Backend to use for all operations. If None, uses the default backend for the given setting. Defaults to None.

  • graph – Whether to return the compiled code representation of this operation instead of computing the result. Defaults to False.

  • **parameters (Union[_Buffer, _SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], bool, int, float, complex, str, bytes, _NestedSequence[bool | int | float | complex | str | bytes]]) – Additional parameters that specify dimension sizes, e.g. a=4.

Return type:

Tensor

Returns:

The result of the operation if graph=False, otherwise the compiled code representation of the operation.