code: def weight_noise(noise_rate, learning_rate, var_list):
      """Apply weight noise to vars in var_list."""
      if not noise_rate:
          return [tf.no_op()]
  
      tf.logging.info(
          "Applying weight noise scaled by learning rate, "
          "noise_rate: %0.5f",
          noise_rate,
      )
  
      noise_ops = []
  
      for v in var_list:
          with tf.device(v.device):  # pylint: disable=protected-access
              scale = noise_rate * learning_rate * 0.001
              if common_layers.should_generate_summaries():
                  tf.summary.scalar("weight_noise_scale", scale)
              noise = tf.truncated_normal(v.shape) * scale
              noise_op = v.assign_add(noise)
              noise_ops.append(noise_op)
  
      return noise_ops
  
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 12 for calling a global function with example usage: weight_noise(noise_rate, learning_rate, var_list) and returns: noise_ops, list