MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / variable_accessed

Function variable_accessed

tensorflow/python/ops/resource_variable_ops.py:309–314  ·  view source on GitHub ↗

Records that `variable` was accessed for the tape and FuncGraph.

(variable)

Source from the content-addressed store, hash-verified

307
308
309def 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
317class BaseResourceVariable(variables.VariableV1):

Callers 6

_read_variable_opMethod · 0.90
_read_variable_opMethod · 0.90
_read_variable_opMethod · 0.70
sparse_readMethod · 0.70
gather_ndMethod · 0.70
_lazy_readMethod · 0.70

Calls 1

watch_variableMethod · 0.80

Tested by

no test coverage detected