code: def minibatch_mean_stddev(x):
      """Computes the standard deviation average.
  
      This is used by the discriminator as a form of batch discrimination.
  
      Args:
        x: A `Tensor` for which to compute the standard deviation average. The first
            dimension must be batch size.
  
      Returns:
        A scalar `Tensor` which is the mean variance of variable x.
      """
      mean, var = tf.nn.moments(x, axes=[0])
      del mean
      return tf.reduce_mean(tf.sqrt(var + 1e-6))
  
file_path: magenta/magenta/models/gansynth/lib/layers.py
imports: import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 7 for calling a global function with example usage: minibatch_mean_stddev(x) and returns: tf