As the error suggests, there’s no “j” in your code.
I believe you saw this post, so you would not need the “index j” (which you don’t need when doing vector calculations), just multiply v2 and v1 elementwise and sum them. In other words do the same thing:
but without “j”.
Cheers
P.S. Note, that you could achieve the same thing with tf.linalg.matmul
but for some reason, the course creators wanted us to use tf.math.reduce_sum
.