code: def _add_scaled_noise_to_gradients(
      grads_and_vars, gradient_noise_scale
  ):
      """Adds scaled noise from a 0-mean normal distribution to gradients."""
      gradients, variables = zip(*grads_and_vars)
      noisy_gradients = []
      for gradient in gradients:
          if gradient is None:
              noisy_gradients.append(None)
              continue
          if isinstance(gradient, ops.IndexedSlices):
              gradient_shape = gradient.dense_shape
          else:
              gradient_shape = gradient.get_shape()
          noise = (
              random_ops.truncated_normal(gradient_shape)
              * gradient_noise_scale
          )
          noisy_gradients.append(gradient + noise)
      return list(zip(noisy_gradients, variables))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import six
  from ..None import contrib_framework
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import clip_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import init_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import variables
  from tensorflow.python.summary import summary
  from tensorflow.python.training import moving_averages
  from tensorflow.python.training import optimizer
  from tensorflow.python.training import training
label_desc: Use image node_id 5 for calling a global function with example usage: _add_scaled_noise_to_gradients(grads_and_vars, gradient_noise_scale) and returns: list