Welcome to StackOverFlow!
Not knowing the rest of your code, in particular not knowing the shape of your matrices, my best guess is that you're trying to multiply together matrices whose dimensions don't match as they're supposed to.
Let me cite a passage from this article by PennState:
To perform matrix multiplication, the first matrix must have the same number of columns as the second matrix has rows.
Whenever you're using the @ operator you're telling Python that you're doing Matrix multiplication!
Let's take the following two matrices as an example:
import numpy as np
X = np.array([[1, 2], [3, 4], [5, 6]])
Y = np.array([[7, 8, 9], [9, 10, 11]])
X has ha shape of (3, 2) whilst Y has a shape of (2, 3). This means that they can indeed be multiplied, and that the resulting matrix will have a (3, 3) shape.
print(X @ Y)
######### Output #########
# [[ 25 28 31]
# [ 57 64 71]
# [ 89 100 111]]
##########################
Now let's say you tried transposing the matrix Y, that is, inverting its rows and cols, making it a (3, 2) matrix. What would you expect to happen?
Yes, you guessed it, Python would tell you that you're doing something wrong, as this operation is not allowed in Linear Algebra.
# Matrix Multiplication between X and Y transposed
print(X @ Y.T)
######### Output #########
# ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0
# with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 3 is different from 2)
##########################
The only thing you should be doing, therefore, is simply checking your matrices dimensions with a command like Y.shape and correcting your mistake.
I hope this helps : )