message: Not using a control flow context when building eager functions.
diff: @@ -405,18 +405,7 @@ class GraphModeFunction(object):
  c_known_ops = set()
  c_captured_tensors = set()
  - def add_op_internal(op):
  - if op.type in ["Variable", "VariableV2", "VarHandleOp"]:
  - raise ValueError("tfe.defun cannot capture variables created without "
  - "using tf.get_variable. Op: %s" % op)
  - c_known_ops.add(op)
  - for i in op.inputs:
  - if i.op not in c_known_ops:
  - c_captured_tensors.add(i)
  -
  - c = HelperContext(add_op_internal)
  -
  - with c:
  + existing_op_len = len(self._graph.get_operations())
  filtered_outputs = [x for x in self._returns if x is not None]
  self._out_grad_placeholders = [
  graph_placeholder(x.dtype, x.shape) for x in filtered_outputs]
  @@ -424,6 +413,14 @@ class GraphModeFunction(object):
  filtered_outputs,
  self._input_placeholders,
  grad_ys=self._out_grad_placeholders)
  + for op in self._graph.get_operations()[existing_op_len:]:
  + if op.type in ["Variable", "VariableV2", "VarHandleOp"]:
  + raise ValueError("tfe.defun cannot capture variables created without "
  + "using tf.get_variable. Op: %s" % op)
  + c_known_ops.add(op)
  + for i in op.inputs:
  + if i.op not in c_known_ops:
  + c_captured_tensors.add(i)
  backward_outputs = tuple(
  grad for grad in _flatten(in_gradients) if grad is not None)
  