parameters: (rate, variables=None)
return_statement: return tf.group(*ops)
docstring: Create an Op that performs weight decay.
docstring_summary: Create an Op that performs weight decay.
docstring_tokens: Create an Op that performs weight decay .
function: def weight_decay(rate, variables=None):
      """
      Create an Op that performs weight decay.
      """
      if variables is None:
          variables = tf.trainable_variables()
      ops = [tf.assign(var, var * rate) for var in variables]
      return tf.group(*ops)
function_tokens: def weight_decay ( rate , variables = None ) : if variables is None : variables = tf . trainable_variables ( ) ops = [ tf . assign ( var , var * rate ) for var in variables ] return tf . group ( * ops )