code: def compute_data_mean_and_std(data, axis, num_samples):
      """Computes data mean and std."""
      with tf.Session() as sess:
          sess.run(
              [
                  tf.global_variables_initializer(),
                  tf.local_variables_initializer(),
                  tf.tables_initializer(),
              ]
          )
          with tf_slim.queues.QueueRunners(sess):
              data_value = np.concatenate(
                  [sess.run(data) for _ in range(num_samples)], axis=0
              )
      mean = np.mean(data_value, axis=tuple(axis), keepdims=True)
      std = np.std(data_value, axis=tuple(axis), keepdims=True)
      return mean, std
  
file_path: magenta/magenta/models/gansynth/lib/util.py
imports: import io
  import os
  from absl import logging
  import numpy
  import tensorflow.compat.v1
  import tf_slim
label_desc: Use image node_id 6 for calling a global function with example usage: compute_data_mean_and_std(data, axis, num_samples) and returns: mean,  std