This is a pre-release version (latest). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy latest / numpy / _core / einsumfunc / _parse_eq_to_batch_matmul

_lru_cache_wrapper

numpy._core.einsumfunc:_parse_eq_to_batch_matmul

source: build-install/usr/lib/python3.14/site-packages/numpy/_core/einsumfunc.py :970

Signature

def   _parse_eq_to_batch_matmul ( eq shape_a shape_b )

Summary

Cached parsing of a two term einsum equation into the necessary sequence of arguments for contracttion via batched matrix multiplication. The steps we need to specify are:

Extended Summary

  • Remove repeated and trivial indices from the left and right terms, and transpose them, done as a single einsum.

  • Fuse the remaining indices so we have two 3D tensors.

  • Perform the batched matrix multiplication.

  • Unfuse the output to get the desired final index order.

Aliases

  • numpy._core.einsumfunc._parse_eq_to_batch_matmul