aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/client
diff options
context:
space:
mode:
authorGravatar Skye Wanderman-Milne <skyewm@google.com>2018-09-05 11:08:52 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-05 11:14:10 -0700
commita6c4916764392819f3692dc0f763472d22b8076f (patch)
tree84984ebcf2bc121e268946fa65cfdaa95ea94be4 /tensorflow/python/client
parent6aa8abbb17c06fbaeb9cc4396e58b6cfc33d177f (diff)
Allow gradients() calls from inside a tfe.defun wrt captured tensors.
This modifies https://github.com/tensorflow/tensorflow/commit/834da2c3fddab1bbbce742db572cfe65dd320fcd to work with tfe.defun in addition to the legacy Defun implementation. PiperOrigin-RevId: 211663702
Diffstat (limited to 'tensorflow/python/client')
-rw-r--r--tensorflow/python/client/session_test.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tensorflow/python/client/session_test.py b/tensorflow/python/client/session_test.py
index 052be68385..f87a96e547 100644
--- a/tensorflow/python/client/session_test.py
+++ b/tensorflow/python/client/session_test.py
@@ -49,6 +49,8 @@ from tensorflow.python.ops import array_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import data_flow_ops
from tensorflow.python.ops import gen_control_flow_ops
+# Import gradients to resolve circular imports
+from tensorflow.python.ops import gradients # pylint: disable=unused-import
from tensorflow.python.ops import gradients_impl
from tensorflow.python.ops import math_ops
# Import resource_variable_ops for the variables-to-tensor implicit conversion.