mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
Change tf_utils.py get_weights to evaluate all tensors at once rather than calling tensor.eval per-tensor. (#8491)
This commit is contained in:
parent
6c5ea32857
commit
a73c488c74
1 changed files with 1 additions and 4 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue