docstr: Test that actnorm data dependent initialization works on forward pass.
docstr_tok: ["Test","that","actnorm","data","dependent","initialization","works","on","forward","pass","."]
code: def testDataInit_forward(self):
      """Test that actnorm data dependent initialization works on forward pass."""
      bijection = self._create_glow(actnorm=True)
      self.evaluate([v.initializer for v in bijection.variables])
      y = np.float32(np.random.normal(0.0, 1.0, [5, 768]))
      nblocks = 0
      made_a_check = False
      splits = bijection.bijectors[1].blockwise_splits
      splits = [[bs[0] + bs[1], bs[2]] for bs in splits]
  
      for b in reversed(bijection.bijectors[1].bijectors):
          if isinstance(b, blockwise._Blockwise):
              y1, y2 = tf.split(y, splits[nblocks], axis=-1)
  
              for bb in reversed(b.bijectors[0].bijectors):
                  if isinstance(bb, glow.ActivationNormalization):
                      y1 = self.evaluate(bb.forward(y1))
                      mean = self.evaluate(
                          tf.reduce_mean(y1, axis=(-4, -3, -2))
                      )
                      stddev = self.evaluate(
                          tf.math.reduce_std(y1, axis=(-4, -3, -2))
                      )
                      self.assertAllClose(
                          mean, tf.zeros_like(mean), atol=1e-5
                      )
                      self.assertAllClose(
                          stddev,
                          tf.ones_like(stddev),
                          atol=0,
                          rtol=5e-5,
                      )
                      made_a_check = True
                  else:
                      y1 = self.evaluate(bb.forward(y1))
              y = tf.concat([y1, y2], axis=-1)
              nblocks += 1
  
          elif isinstance(b, composition.Composition):
              for bb in reversed(b.bijectors):
                  y = self.evaluate(bb.forward(y))
                  if isinstance(bb, glow.ActivationNormalization):
                      mean = tf.reduce_mean(y, axis=(-4, -3, -2))
                      stddev = tf.math.reduce_std(y, axis=(-4, -3, -2))
                      self.assertAllClose(
                          mean, tf.zeros_like(mean), atol=1e-5
                      )
                      self.assertAllClose(
                          stddev,
                          tf.ones_like(stddev),
                          atol=0,
                          rtol=5e-5,
                      )
                      made_a_check = True
          else:
              y = self.evaluate(b.forward(y))
      assert made_a_check
  
imports: import functools
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.bijectors import blockwise
  from tensorflow_probability.python.bijectors import chain
  from tensorflow_probability.python.bijectors import composition
  from tensorflow_probability.python.bijectors import glow
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.bijectors import pad
  from tensorflow_probability.python.bijectors import sigmoid
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.internal import tf_keras
  from tensorflow_probability.python.math.gradient import batch_jacobian
label_desc: Use image node_id 7 for calling the GlowTest obj's underlying member method code with example usage: obj.testDataInit_forward() without return types