Records that `variable` was accessed for the tape and FuncGraph.
(variable)
| 307 | |
| 308 | |
| 309 | def variable_accessed(variable): |
| 310 | """Records that `variable` was accessed for the tape and FuncGraph.""" |
| 311 | if hasattr(ops.get_default_graph(), "watch_variable"): |
| 312 | ops.get_default_graph().watch_variable(variable) |
| 313 | if variable.trainable: |
| 314 | tape.variable_accessed(variable) |
| 315 | |
| 316 | |
| 317 | class BaseResourceVariable(variables.VariableV1): |
no test coverage detected