code: def test_constant_samples(self):
      batch_size = 3
      resolution = 64
      n_channels = 3
  
      batch = tf.concat(
          [
              tf.ones([1, resolution, resolution, n_channels])
              * (batch + 1)
              for batch in range(batch_size)
          ],
          0,
      )
  
      mean = 2.0
      expected_stddeviation = tf.sqrt(
          ((3.0 - mean) ** 2 + (2.0 - mean) ** 2 + (1.0 - mean) ** 2)
          / 3
      )
  
      layer = minibatch_standarddeviation.MiniBatchStandardDeviation()
      layer.build(batch.shape)
  
      expected = tf.concat(
          [
              batch,
              tf.broadcast_to(
                  expected_stddeviation, batch.shape[:-1] + [1]
              ),
          ],
          3,
      )
  
      difference = tf.abs(layer.call(batch) - expected)
      epsilon = 1e-5
      is_equal = difference < epsilon
  
      self.assertTrue(tf.math.reduce_all(is_equal))
  
file_path: graphics/tensorflow_graphics/projects/gan/minibatch_standarddeviation_test.py
imports: import tensorflow
  from tensorflow_graphics.projects.gan import minibatch_standarddeviation
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 2 for calling the MinibatchStandarddeviationTest obj's underlying member method code with example usage: obj.test_constant_samples() without return types