parameters: (self, vecs_and_vars, decay, vec_coeff=1.0)
return_statement: return [_update_velocity(vec, var) for vec, var in vecs_and_vars]
docstring: Updates the velocities of the variables with the given vectors.
  
      Args:
        vecs_and_vars: List of (vector, variable) pairs.
        decay: How much to decay the old velocity by.  This is often referred to
          as the 'momentum constant'.
        vec_coeff: Coefficient to apply to the vectors before adding them to the
          velocity.
  
      Returns:
        A list of (velocity, var) indicating the new velocity for each var.
docstring_summary: Updates the velocities of the variables with the given vectors.
docstring_tokens: Updates the velocities of the variables with the given vectors .
function: def _update_velocities(self, vecs_and_vars, decay, vec_coeff=1.0):
      """Updates the velocities of the variables with the given vectors.
  
      Args:
        vecs_and_vars: List of (vector, variable) pairs.
        decay: How much to decay the old velocity by.  This is often referred to
          as the 'momentum constant'.
        vec_coeff: Coefficient to apply to the vectors before adding them to the
          velocity.
  
      Returns:
        A list of (velocity, var) indicating the new velocity for each var.
      """
  
      def _update_velocity(vec, var):
        velocity = self._zeros_slot(var, "velocity", self._name)
        with ops.colocate_with(velocity):
          # NOTE(mattjj): read/modify/write race condition not suitable for async.
  
          # Compute the new velocity for this variable.
          new_velocity = decay * velocity + vec_coeff * vec
  
          # Save the updated velocity.
          return (array_ops.identity(velocity.assign(new_velocity)), var)
  
      # Go through variable and update its associated part of the velocity vector.
      return [_update_velocity(vec, var) for vec, var in vecs_and_vars]
function_tokens: def _update_velocities ( self , vecs_and_vars , decay , vec_coeff = 1.0 ) : def _update_velocity ( vec , var ) : velocity = self . _zeros_slot ( var , "velocity" , self . _name ) with ops . colocate_with ( velocity ) : # NOTE(mattjj): read/modify/write race condition not suitable for async. # Compute the new velocity for this variable. new_velocity = decay * velocity + vec_coeff * vec # Save the updated velocity. return ( array_ops . identity ( velocity . assign ( new_velocity ) ) , var ) # Go through variable and update its associated part of the velocity vector. return [ _update_velocity ( vec , var ) for vec , var in vecs_and_vars ]