If x is ResourceVariable, return its handle, else x.
(x)
| 682 | |
| 683 | |
| 684 | def _handle_or_self(x): |
| 685 | """If x is ResourceVariable, return its handle, else x.""" |
| 686 | if resource_variable_ops.is_resource_variable(x): |
| 687 | x = x.handle |
| 688 | return x |
| 689 | |
| 690 | |
| 691 | @tf_export("GradientTape") |