I just found the answer. There were two problems.


I was misunderstanding the shape of y_true and y_pred. It is [Batch_size,(Input_shape)].
Which means the shapes were not [3,7], but rather [32,3,7].


The size is supposed to be [1,1,1]. The reason I was getting an error for doing this before is unknown.


I did not know that custom metrics become a tf.function, but after I discovered that all I had to do was
tf.config.run_functions_eagerly(True) to debug this.
I hope this helps anybody running into the same problem.