I have an array of shape N, j, j and another of shape M, j, j. I want to calculate their tensor dot to eventually have a matrix where the i,j
N, j, j
M, j, j
i,j