code: def testRegularMask(self, num_masked, fraction_masked, batch_shape):
      x_ = np.random.normal(0.0, 1.0, batch_shape + (8,)).astype(
          np.float32
      )
      nvp = real_nvp.RealNVP(
          num_masked=num_masked,
          fraction_masked=fraction_masked,
          validate_args=True,
          **self._real_nvp_kwargs,
      )
      x = tf.constant(x_)
      forward_x = nvp.forward(x)
      # Use identity to invalidate cache.
      inverse_y = nvp.inverse(tf.identity(forward_x))
      forward_inverse_y = nvp.forward(inverse_y)
      fldj = nvp.forward_log_det_jacobian(x, event_ndims=1)
      # Use identity to invalidate cache.
      ildj = nvp.inverse_log_det_jacobian(
          tf.identity(forward_x), event_ndims=1
      )
      self.evaluate(tf1.global_variables_initializer())
      [
          forward_x_,
          inverse_y_,
          forward_inverse_y_,
          ildj_,
          fldj_,
      ] = self.evaluate(
          [
              forward_x,
              inverse_y,
              forward_inverse_y,
              ildj,
              fldj,
          ]
      )
      self.assertStartsWith(nvp.name, "real_nvp")
      self.assertAllClose(
          forward_x_, forward_inverse_y_, rtol=1e-4, atol=0.0
      )
      self.assertAllClose(x_, inverse_y_, rtol=1e-4, atol=0.0)
      self.assertAllClose(ildj_, -fldj_, rtol=1e-6, atol=0.0)
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import inline
  from tensorflow_probability.python.bijectors import invert
  from tensorflow_probability.python.bijectors import real_nvp
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.bijectors import shift
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import sample
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.internal import tf_keras
label_desc: Use image node_id 1 for calling the RealNVPTestBase obj's underlying member method code with example usage: obj.testRegularMask(num_masked, fraction_masked, batch_shape) without return types