diff options
Diffstat (limited to 'tensorflow/python/ops/control_flow_util.py')
-rw-r--r-- | tensorflow/python/ops/control_flow_util.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tensorflow/python/ops/control_flow_util.py b/tensorflow/python/ops/control_flow_util.py index 7a18986c5b..72c074ed1a 100644 --- a/tensorflow/python/ops/control_flow_util.py +++ b/tensorflow/python/ops/control_flow_util.py @@ -214,6 +214,14 @@ def IsContainingContext(ctxt, maybe_containing_ctxt): return True +def OpInContext(op, ctxt): + return IsContainingContext(op._get_control_flow_context(), ctxt) # pylint: disable=protected-access + + +def TensorInContext(tensor, ctxt): + return OpInContext(tensor.op, ctxt) + + def CheckInputFromValidContext(op, input_op): """Returns whether `input_op` can be used from `op`s context. |