einsum
Wrapper for einsums intended to supply the fastest einsum implementation and perform the required type conversions.
- einsum(einsum_notation: str, *tensors: ndarray | Tensor) ndarray[source]
Einsum wrapper that accepts numpy arrays and torch tensors.
It is a wrapper intended to use the in our opinion faster implementation of einsum and perform the required type conversions. Currently, the pytorch einsum implementation seems to be faster than numpy even on the cpu and using numpy optimization.
- Parameters:
einsum_notation – einsum notation string
*tensors – tensors to be multiplied
- Returns:
einsum result
Note
this function might be prone to changes in the future