message: [defun] Clarifying add_to_graph, and do nothing if executing eagerly.
diff: @@ -537,11 +537,17 @@ class Function(object):
  self._func_graph.structured_outputs)
  def add_to_graph(self, g=None, register_gradient_functions=False):
  - """Registers the function into the graph g."""
  + """Registers the function, adds it to the graph g or default graph."""
  + # If we are not executing eagerly, adds the function to default graph if no
  + # graph is specified.
  + # In case of eager execution, function definition gets added to context
  + # during construction itself.
  +
  # TODO(allel/shivaniagrawal): rename this to register to reflect the
  # method's functionality better. Remove register_gradient_functions argument
  # and figure out if these needs to be registered.
  + if not context.executing_eagerly() or g:
  if not g:
  g = ops.get_default_graph()
  self._inference_function.add_to_graph(g) # pylint: disable=protected-access
  @@ -552,8 +558,8 @@ class Function(object):
  # 1. If none of the input args are resource variables or watch by any
  # tape, and it will run the _inference_function of concrete_func for
  # forward pass, the gradient will be generated by standard mechanism.
  - # 2. Otherwise, defun will create two functions, one for forward pass, and
  - # the backward pass will be created via tape.
  + # 2. Otherwise, defun will create two functions, one for forward pass,
  + # and the backward pass will be created via tape.
  # When registering the function, we register both cases.
  if self._backward_graph_function is None:
  self._construct_backprop_function()
  