In the Pytorch, we can access the gradient of a variable x by
z.grad
What is the same sytax in Tensorflow 2. My goad is to cut the gradient. Here is Pytorch code
if z.grad > 1000:
z.grad = 10
Can tensorflow 2 apply the same functions?
Thanks