Gram matrix precision error

assertion failed because of a precision error, how can i correct it?

my GA is printed above, it is good up to the second decimal

disregard this one, my code is fine

Meaning that you fixed whatever the bug was in your first post here, I assume. An error in the second decimal place is not a rounding error: it must be a substantive error in your code. We are working in 64 bit floating point here, so rounding errors are typically of order 10^{-14} or smaller.

my code is correct, but when i run it in my computer it gave me this error, but in coursera environment run just fine

Could be due to a difference in tool versions.

Yes, the gram_matrix code is pretty simple and just depends on matmul and transpose, but the test routine does the usual thing of randomly generating the inputs. They set the seed, but it must be that TF changed the behavior of the PRNG functions in some way.