parameters: (self, val)
return_statement: return result
docstring: Add `val` to the current context and its outer context recursively.
docstring_summary: Add `val` to the current context and its outer context recursively.
docstring_tokens: Add val to the current context and its outer context recursively .
function: def AddValue(self, val):
      """Add `val` to the current context and its outer context recursively."""
      if val.name in self._values:
        # Use the real value if it comes from outer context. This is needed in
        # particular for nested conds.
        result = self._external_values.get(val.name)
        result = val if result is None else result
      else:
        result = val
        self._values.add(val.name)
        if self._outer_context:
          result = self._outer_context.AddValue(val)
          self._values.add(result.name)
        with ops.control_dependencies(None):
          result = _SwitchRefOrTensor(result, self._pred)[self._branch]
        # pylint: disable=protected-access
        result.op._set_control_flow_context(self)
        # pylint: enable=protected-access
  
        self._values.add(result.name)
        self._external_values[val.name] = result
      return result
function_tokens: def AddValue ( self , val ) : if val . name in self . _values : # Use the real value if it comes from outer context. This is needed in # particular for nested conds. result = self . _external_values . get ( val . name ) result = val if result is None else result else : result = val self . _values . add ( val . name ) if self . _outer_context : result = self . _outer_context . AddValue ( val ) self . _values . add ( result . name ) with ops . control_dependencies ( None ) : result = _SwitchRefOrTensor ( result , self . _pred ) [ self . _branch ] # pylint: disable=protected-access result . op . _set_control_flow_context ( self ) # pylint: enable=protected-access self . _values . add ( result . name ) self . _external_values [ val . name ] = result return result