docstr: Test that actnorm data dependent initialization works on inverse pass.
docstr_tok: ["Test","that","actnorm","data","dependent","initialization","works","on","inverse","pass","."]
code: def testDataInit_inverse(self):
      """Test that actnorm data dependent initialization works on inverse pass."""
      bijection = self._create_glow(actnorm=True)
      self.evaluate([v.initializer for v in bijection.variables])
      x = self._make_images()
      nblocks = 0
      made_a_check = False
      splits = bijection.bijectors[1].blockwise_splits
      splits = [[bs[0] + bs[1], bs[2]] for bs in splits]
  
      x = bijection.bijectors[0].inverse(x)
      for b in bijection.bijectors[1].bijectors:
          if isinstance(b, blockwise._Blockwise):
              x1, x2 = tf.split(x, splits[-2 - nblocks], axis=-1)
  
              for bb in b.bijectors[0].bijectors:
                  if isinstance(bb, glow.ActivationNormalization):
                      x1 = self.evaluate(bb.inverse(x1))
                      mean = self.evaluate(
                          tf.reduce_mean(x1, axis=(-4, -3, -2))
                      )
                      stddev = self.evaluate(
                          tf.math.reduce_std(x1, 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:
                      x1 = self.evaluate(bb.inverse(x1))
              x = tf.concat([x1, x2], axis=-1)
              nblocks += 1
  
          elif isinstance(b, composition.Composition):
              for bb in b.bijectors:
                  x = self.evaluate(bb.inverse(x))
                  if isinstance(bb, glow.ActivationNormalization):
                      mean = tf.reduce_mean(x, axis=(-4, -3, -2))
                      stddev = tf.math.reduce_std(x, 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:
              x = self.evaluate(b.inverse(x))
  
      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 6 for calling the GlowTest obj's underlying member method code with example usage: obj.testDataInit_inverse() without return types