I'm not sure if we need to keep the same axes as tensordot or should -1 as you did. Why did you do it like that?