Add support for tensorflow resource variables (#4438)

* Adding support for resource variables

Currently resource variable go undetected by the `TensorFlowVariables` since they do not use the same ops for reading values. This change should fix this until a more robust solution is implemented.

* fix varhandle
This commit is contained in:
gehring 2019-03-29 16:23:05 -04:00 committed by Eric Liang
parent 77005d1814
commit 5133b10700

View file

@ -76,7 +76,8 @@ class TensorFlowVariables(object):
if control not in explored_inputs:
queue.append(control)
explored_inputs.add(control)
if "Variable" in tf_obj.node_def.op:
if ("Variable" in tf_obj.node_def.op
or "VarHandle" in tf_obj.node_def.op):
variable_names.append(tf_obj.node_def.name)
self.variables = OrderedDict()
variable_list = [