From a73c488c74b1e01da3961db2eb538c43c29753f5 Mon Sep 17 00:00:00 2001 From: internetcoffeephone Date: Tue, 19 May 2020 07:06:03 +0200 Subject: [PATCH] Change tf_utils.py get_weights to evaluate all tensors at once rather than calling tensor.eval per-tensor. (#8491) --- python/ray/experimental/tf_utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/python/ray/experimental/tf_utils.py b/python/ray/experimental/tf_utils.py index bdddc6a96..8fa0d4552 100644 --- a/python/ray/experimental/tf_utils.py +++ b/python/ray/experimental/tf_utils.py @@ -161,10 +161,7 @@ class TensorFlowVariables: Dictionary mapping variable names to their weights. """ self._check_sess() - return { - k: v.eval(session=self.sess) - for k, v in self.variables.items() - } + return self.sess.run(self.variables) def set_weights(self, new_weights): """Sets the weights to new_weights.