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

Method variables

tensorflow/python/framework/func_graph.py:422–440  ·  view source on GitHub ↗

A list of variables accessed by this FuncGraph. Note that functions keep only weak references to variables. Calling the function after a variable it accesses has been deleted is an error. Yields: Strong references to variables accessed by this FuncGraph.

(self)

Source from the content-addressed store, hash-verified

420
421 @property
422 def variables(self):
423 """A list of variables accessed by this FuncGraph.
424
425 Note that functions keep only weak references to variables. Calling the
426 function after a variable it accesses has been deleted is an error.
427
428 Yields:
429 Strong references to variables accessed by this FuncGraph.
430 """
431 for weak_v in self._weak_variables:
432 v = weak_v()
433 if v is None:
434 raise AssertionError(
435 "Called a function referencing variables which have been deleted. "
436 "This likely means that function-local variables were created and "
437 "not referenced elsewhere in the program. This is generally a "
438 "mistake; consider storing variables in an object attribute on "
439 "first call.")
440 yield v
441
442 @variables.setter
443 def variables(self, var_list):

Callers

nothing calls this directly

Calls 1

refMethod · 0.80

Tested by

no test coverage detected