I was working with mixed_precision earlier today seems things were working smoothly but not sure when I tried to run the same block of code it throws an error.

code1870×762 160 KB


error2496×684 128 KB

And the TensorFlow version I am running on is 2.5.0. Downgrading to version 2.4.1 works fine. Any help with this?
Also reading some of the old threads seems it has been fixed after the version update.