Also, could you post all shapes and values of the tensors so that we can reproduce this error?
The error message isn’t really helpful in this case.

Yes, sorry about that but it’s really hard to give you the weights since they were parsed using this graph. The shapes can be deduced from the code though. M and M_hat are (4847571, 4847571) and v is (4847571, 1).
Actually the error is the same as this 44 one and it has been solved in the current master.
Thanks for taking the time though!