LookupError: gradient registry has no entry for: ClipByValue
Hi, @shkarupa-alex 

Aplogize for the delay and I was able to replicate the same issue with `tf-nightly `on Google Colab and also on `Ubuntu 20.04 `, for your reference I have added [gist-file-tf-nightly ](https://colab.research.google.com/gist/gaikwadrahul8/8621f06354de07d8e85b7c192f666e80/-59642-test.ipynb)and screenshot below and it's giving me same error as you mentioned above in the error log output `LookupError: gradient registry has no entry for: ClipByValue`

Here is screenshot for code execution on `Ubuntu 20.04` with `tf-nightly`:

![image](https://user-images.githubusercontent.com/115997457/219008278-630079bb-42a6-4f98-9be7-defa3bb678eb.png)


I tried the same code on latest stable version of `Tensorflow==2.11 `and it's working fine as expected for your reference I have added [gist-file-tf-2.11](https://colab.research.google.com/gist/gaikwadrahul8/4e16d616590f8a3b8d206cd62196aa5b/-59642-test.ipynb). Thank you! This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Thank you.
 Closing as stale. Please reopen if you'd like to work on this further.
 Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59642">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59642">No</a>
 Hi, @shkarupa-alex 

I apologize for this issue got closed after stale from Bot so I re-opened this issue and I have tested the same code with `Tf-nightly `and our tensorflow pre-release `tensorflow==2.12.0rc0`, I'm getting the same error, for your reference I have added [gist-file](https://colab.research.google.com/gist/gaikwadrahul8/e208d73957480f560d4ed23dddbad356/-59642-test.ipynb) and we'll have to dig more into this issue and we'll update you soon. Thank you! Hi, @sachinprasadhs 

Could you please look into this issue ? Thank you! @qlzh727, the ClipByValue gradient is commented out and there is a TODO assigned to you from 2018: https://cs.opensource.google/tensorflow/tensorflow/+/master:tensorflow/python/ops/clip_ops.py;l=126;drc=ec69e86e01436b58d53f49b12782a0452bd26c8c. Do you remember why it's commented out? > @qlzh727, the ClipByValue gradient is commented out and there is a TODO assigned to you from 2018: https://cs.opensource.google/tensorflow/tensorflow/+/master:tensorflow/python/ops/clip_ops.py;l=126;drc=ec69e86e01436b58d53f49b12782a0452bd26c8c. Do you remember why it's commented out?

I think I did this when I was on sync rotation for TF, and it was failing for the presubmit when I try to merge the change. I don't remember for the context of what's the failure now. Maybe we can try to re-enable it again? @qlzh727 can you do this? If you don't have time I can try. > @qlzh727 can you do this? If you don't have time I can try.

I am actually quite booked for other tasks at the moment. Thanks for the help. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59642">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59642">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

### Have you reproduced the bug with TF nightly?

Yes

### Source

binary

### Tensorflow Version

2.13.0-dev20230210

### Custom Code

Yes

### OS Platform and Distribution

Google Colab

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

```shell
Error occurred when mixed precision policy and `tf.saturate_cast` used together.
No error without mixed precision policy.
```


### Standalone code to reproduce the issue

```shell
https://colab.research.google.com/drive/1hWTWBG7S8h6q4DK1qBNl2id0aK7h-3n4?usp=sharing
```


### Relevant log output

```shell
---------------------------------------------------------------------------
StagingError                              Traceback (most recent call last)
<ipython-input-6-1edf848c14d2> in <module>
     12 model = models.Model(inputs=inputs, outputs=outputs)
     13 model.compile(optimizer='adam', loss='mse', run_eagerly=False, jit_compile=True)
---> 14 model.fit(images, labels, epochs=1, batch_size=2)

1 frames
/usr/local/lib/python3.8/dist-packages/keras/utils/traceback_utils.py in error_handler(*args, **kwargs)
     68             # To get the full stack trace, call:
     69             # `tf.debugging.disable_traceback_filtering()`
---> 70             raise e.with_traceback(filtered_tb) from None
     71         finally:
     72             del filtered_tb

/usr/local/lib/python3.8/dist-packages/tensorflow/python/framework/func_graph.py in autograph_handler(*args, **kwargs)
   1169           except Exception as e:  # pylint:disable=broad-except
   1170             if hasattr(e, "ag_error_metadata"):
-> 1171               raise e.ag_error_metadata.to_exception(e)
   1172             else:
   1173               raise

StagingError: in user code:

    File "/usr/local/lib/python3.8/dist-packages/keras/engine/training.py", line 1284, in train_function  *
        return step_function(self, iterator)
    File "/usr/local/lib/python3.8/dist-packages/keras/engine/training.py", line 1249, in run_step  *
        outputs = model.train_step(data)
    File "/usr/local/lib/python3.8/dist-packages/keras/engine/training.py", line 1054, in train_step  **
        self.optimizer.minimize(loss, self.trainable_variables, tape=tape)
    File "/usr/local/lib/python3.8/dist-packages/keras/optimizers/optimizer.py", line 542, in minimize
        grads_and_vars = self.compute_gradients(loss, var_list, tape)
    File "/usr/local/lib/python3.8/dist-packages/keras/mixed_precision/loss_scale_optimizer.py", line 1249, in compute_gradients
        grads_and_vars = self._optimizer.compute_gradients(
    File "/usr/local/lib/python3.8/dist-packages/keras/optimizers/optimizer.py", line 275, in compute_gradients
        grads = tape.gradient(loss, var_list)

    LookupError: gradient registry has no entry for: ClipByValue
```
</details>