parameters: (self, name, initial_value, dtype=None)
return_statement: return variable
docstring: Adds a weight to this loss scale.
  
      Args:
        name: Variable name.
        initial_value: The variable's initial value.
        dtype: The type of the variable.
  
      Returns:
        A variable.
  
      Raises:
        RuntimeError: If a weight with `name` has already been added.
docstring_summary: Adds a weight to this loss scale.
docstring_tokens: Adds a weight to this loss scale .
function: def _add_weight(self, name, initial_value, dtype=None):
      """Adds a weight to this loss scale.
  
      Args:
        name: Variable name.
        initial_value: The variable's initial value.
        dtype: The type of the variable.
  
      Returns:
        A variable.
  
      Raises:
        RuntimeError: If a weight with `name` has already been added.
      """
      variable = variable_scope.variable(
          initial_value=initial_value,
          name=name,
          dtype=dtype,
          trainable=False,
          use_resource=True,
          synchronization=variables.VariableSynchronization.AUTO,
          # Set aggregation to NONE, as loss scaling variables should never be
          # aggregated.
          aggregation=variables.VariableAggregation.NONE)
      if context.executing_eagerly():
        graph_key = None
      else:
        graph = ops.get_default_graph()
        graph_key = graph._graph_key  # pylint: disable=protected-access
  
      key = (name, graph_key)
      self._weights[key] = variable
      self._handle_deferred_dependencies(name=name, trackable=variable)
      backend.track_variable(variable)
      return variable
function_tokens: def _add_weight ( self , name , initial_value , dtype = None ) : variable = variable_scope . variable ( initial_value = initial_value , name = name , dtype = dtype , trainable = False , use_resource = True , synchronization = variables . VariableSynchronization . AUTO , # Set aggregation to NONE, as loss scaling variables should never be # aggregated. aggregation = variables . VariableAggregation . NONE ) if context . executing_eagerly ( ) : graph_key = None else : graph = ops . get_default_graph ( ) graph_key = graph . _graph_key # pylint: disable=protected-access key = ( name , graph_key ) self . _weights [ key ] = variable self . _handle_deferred_dependencies ( name = name , trackable = variable ) backend . track_variable ( variable ) return variable