diff options
author | Dan Moldovan <mdan@google.com> | 2018-09-21 07:19:09 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-09-21 07:23:15 -0700 |
commit | 035a84769de2921667677b5530011bbd558ddf0c (patch) | |
tree | 3ff81e7ff0a6e50bd5b04fa486d173e0231ade54 /tensorflow/python/autograph/pyct/static_analysis/live_values.py | |
parent | 200b89761a4665e3de6d0efc4e3e10ab287ad81b (diff) |
Use weakrefs where absolutely safe to do so, in order to reduce the number of circular references. Replace unnecessary OrderedDict with a regular dict.
PiperOrigin-RevId: 213982097
Diffstat (limited to 'tensorflow/python/autograph/pyct/static_analysis/live_values.py')
-rw-r--r-- | tensorflow/python/autograph/pyct/static_analysis/live_values.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/python/autograph/pyct/static_analysis/live_values.py b/tensorflow/python/autograph/pyct/static_analysis/live_values.py index 3963772dad..36b9e7074d 100644 --- a/tensorflow/python/autograph/pyct/static_analysis/live_values.py +++ b/tensorflow/python/autograph/pyct/static_analysis/live_values.py @@ -89,7 +89,8 @@ class LiveValueResolver(transformer.Base): if has_single_def: def_, = defs - if def_.param_of is self.enclosing_entities[0]: + # Note: param_of is a weakref. + if def_.param_of and def_.param_of() is self.enclosing_entities[0]: if node.id in self.entity_info.arg_values: obj = self.entity_info.arg_values[node.id] anno.setanno(node, 'live_val', obj) |