I have two rank three tensors, X and Y of the same dimensions, say n x n x n. I wish to do the equivalent of matrix multiplication on these two tensors. So with regular matrix multiplication, if I multiply two n x n matrices I get another n x n matrix in return. Is there a way to do this with tensors? Clearly I can split my tensors into n sets of n x n matrices and then do matrix multiplication on these to get n new n x n matrices. However this doesn't feel right because I can choosing one specific direction which gets priority over the others.

Note that I am not looking for the tensor product not the inner product of two tensors.

Thanks!