From 5133b10700aca685ca542a77ec92923c4c6a3f25 Mon Sep 17 00:00:00 2001 From: gehring Date: Fri, 29 Mar 2019 16:23:05 -0400 Subject: [PATCH] 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 --- python/ray/experimental/tf_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/ray/experimental/tf_utils.py b/python/ray/experimental/tf_utils.py index bb424134e..d2f1b2599 100644 --- a/python/ray/experimental/tf_utils.py +++ b/python/ray/experimental/tf_utils.py @@ -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 = [