code: def add_variables_summaries(grads_and_vars, step):
      """Add summaries for variables.
  
      Args:
        grads_and_vars: A list of (gradient, variable) pairs.
        step: Variable to use for summaries.
      """
      with tf.name_scope("summarize_vars"):
          for _, var in grads_and_vars:
              if isinstance(var, tf.IndexedSlices):
                  var_values = var.values
              else:
                  var_values = var
              var_name = var.name.replace(":", "_")
              tf.compat.v2.summary.histogram(
                  name=var_name + "_value", data=var_values, step=step
              )
              tf.compat.v2.summary.scalar(
                  name=var_name + "_value_norm",
                  data=tf.linalg.global_norm([var_values]),
                  step=step,
              )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import functools
  import inspect
  from absl import logging
  import numpy
  import six
  import tensorflow
  from tf_agents.utils import common
  from tensorflow.python.util import tf_decorator
label_desc: Use image node_id 4 for calling a global function with example usage: add_variables_summaries(grads_and_vars, step) without return types