[eager]: Correctly handle slot variables inside a defun.
The change in function_test.py would fail with something like
the following without the corresponding changes to the non-test files.
File "/tensorflow/python/training/adam.py", line 163, in _resource_apply_dense
m = self.get_slot(var, "m")
File "/tensorflow/python/training/optimizer.py", line 750, in get_slot
return named_slots.get(_var_key(var), None)
File "/tensorflow/python/training/optimizer.py", line 82, in _var_key
return (var.op.graph, var.op.name)
File "/tensorflow/python/ops/resource_variable_ops.py", line 693, in op
return self._handle.op
File "/tensorflow/python/framework/ops.py", line 867, in op
"Tensor.op is meaningless when eager execution is enabled.")
PiperOrigin-RevId: 203977062
Loading
Please sign in to comment