For an inner product, whatever it may be, to work on two matrices, the last dimension of the left argument must match the first dimension of the right.
Thus a matrix left argument whose shape is 5 2 3 2 will work with a matrix right argument whose shape is 2 3 9. 3 2 matches with 2 3. The shape of the result would be the shape of the left argument without the last element catenated with the shape of the right argumented without the first element, in this case, 5 2 3 3 9.
In the case of vector arguments, the inner single dimension will do.
(1 3 p 1 2 3) +.x 3 1 p 1 2 3 (matrices match)
14
1 2 3 +.x 3 1 p 1 2 3
14
(1 3 p 1 2 3) +.x 1 2 3
14
1 2 3 +.x 1 2 3
14