From 4807604594d8000b89590c9e8d810f255a48f094 Mon Sep 17 00:00:00 2001 From: Yuan Yu Date: Fri, 28 Oct 2016 13:19:42 -0800 Subject: [PATCH] Small cleanup. Change: 137552350 --- tensorflow/python/ops/control_flow_ops.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow/python/ops/control_flow_ops.py b/tensorflow/python/ops/control_flow_ops.py index 596b3f9eecc..49360346b92 100644 --- a/tensorflow/python/ops/control_flow_ops.py +++ b/tensorflow/python/ops/control_flow_ops.py @@ -1180,11 +1180,11 @@ class ControlFlowState(object): if IsLoopSwitch(op): return None dead_branch = IsSwitch(op) forward_ctxt = _GetWhileContext(op) - if forward_ctxt is None: + grad_state = self._map.get(forward_ctxt) + if grad_state is None: # op is not in a while loop that is part of gradients(). return ZerosLikeOutsideLoop(op, index) op_ctxt = op._get_control_flow_context() - grad_state = self._map.get(forward_ctxt) val = ops.convert_to_tensor(op.outputs[index], name="tensor") shape = val.get_shape() if shape.is_fully_defined(): -- GitLab