I have a situation where I want to do a complicated einsum operation across 4 tensors.  I am trying to optimize for memory efficiency, and if the underlying code is breaking this up into multiple matmul operations, it produce intermediate matrices that are far bigger than desired.  My understanding is that other einsum implementations do use matmul as the underlying operation, but I have not found this info about pytorch.  Would this be efficient, and if not is there a clean way to do multiply-accumulate operations across more than 2 matrixes?