code: def weight_decay(decay_rate, var_list, skip_biases=True):
      """Apply weight decay to vars in var_list."""
      if not decay_rate:
          return 0.0
  
      tf.logging.info(
          "Applying weight decay, decay_rate: %0.5f", decay_rate
      )
  
      weight_decays = []
      for v in var_list:
          # Weight decay.
          # This is a heuristic way to detect biases that works for main tf.layers.
          is_bias = len(v.shape.as_list()) == 1 and v.name.endswith(
              "bias:0"
          )
          if not (skip_biases and is_bias):
              with tf.device(v.device):
                  v_loss = tf.nn.l2_loss(v)
              weight_decays.append(v_loss)
  
      return tf.add_n(weight_decays) * decay_rate
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import adafactor
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import misc_utils
  from tensor2tensor.utils import mlperf_log
  from tensor2tensor.utils import multistep_optimizer
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import yellowfin
  import tensorflow.compat.v1
  from tensorflow.python.framework import dtypes
label_desc: Use image node_id 13 for calling a global function with example usage: weight_decay(decay_rate, var_list, skip_biases) and returns: unknown, int