diff options
author | 2017-09-26 13:29:09 -0700 | |
---|---|---|
committer | 2017-09-26 13:36:40 -0700 | |
commit | 9b6b179fe33a0daab4c6b4c7314f77e49825f999 (patch) | |
tree | 22592b41d8809fe7ad83840e963e9d76cd50293d | |
parent | bfa7016612c0255edb6a02d7134f4babacfbf1ca (diff) |
Make ControlFlowContext.AddInnerOp recursively propagate the inner op to the enclosing context by default.
PiperOrigin-RevId: 170099939
-rw-r--r-- | tensorflow/python/ops/control_flow_ops.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/python/ops/control_flow_ops.py b/tensorflow/python/ops/control_flow_ops.py index 4b9b34b49d..d8a538c4e3 100644 --- a/tensorflow/python/ops/control_flow_ops.py +++ b/tensorflow/python/ops/control_flow_ops.py @@ -1496,7 +1496,8 @@ class ControlFlowContext(object): def AddInnerOp(self, op): """Notifies a scope about an operator added to an inner scope.""" - pass + if self._outer_context: + self._outer_context.AddInnerOp(op) def GetControlPivot(self): """Returns the pivot node for this context, or None.""" |