class_docstr: Tests correctness of the power transformation.
class_docstr_tok: ["Tests","correctness","of","the","power","transformation","."]
code: def testBijectorOverRange(self, dtype):
      skewness = np.array([1.2, 5.0], dtype=dtype)
      tailweight = np.array([2.0, 10.0], dtype=dtype)
      # The inverse will be defined up to where sinh is valid, which is
      # for values close to arcsinh(np.finfo(dtype).max).
      # We stray away from the largest value to avoid issues
      # at the boundary since XLA sinh will return `inf` for the largest value.
      max_val = np.nextafter(np.finfo(dtype).max, 0.0) / 10.0
  
      log_boundary = np.log(
          np.sinh(np.arcsinh(max_val) / tailweight - skewness)
      )
      x = np.array(
          [
              np.logspace(-2, log_boundary[0], base=np.e, num=1000),
              np.logspace(-2, log_boundary[1], base=np.e, num=1000),
          ],
          dtype=dtype,
      )
      # Ensure broadcasting works.
      x = np.swapaxes(x, 0, 1)
      multiplier = 2.0 / np.sinh(np.arcsinh(2.0) * tailweight)
      y = np.sinh((np.arcsinh(x) + skewness) * tailweight) * multiplier
      bijector = sinh_arcsinh.SinhArcsinh(
          skewness=skewness, tailweight=tailweight, validate_args=True
      )
  
      self.assertAllClose(
          y, self.evaluate(bijector.forward(x)), rtol=1e-4, atol=0.0
      )
      self.assertAllClose(
          x, self.evaluate(bijector.inverse(y)), rtol=1e-4, atol=0.0
      )
  
      # On IBM PPC systems, longdouble (np.float128) is same as double except
      # that it can have more precision. Type double being of 8 bytes, can't
      # hold square of max of float64 (which is also 8 bytes).
      # Below test fails due to overflow error giving inf. This check avoids
      # that error by skipping square calculation and corresponding assert.
  
      if np.amax(y) <= np.sqrt(np.finfo(np.float128).max) and np.fabs(
          np.amin(y)
      ) <= np.sqrt(np.fabs(np.finfo(np.float128).min)):
          # Do the numpy calculation in float128 to avoid inf/nan.
          y_float128 = np.float128(y)
          self.assertAllClose(
              np.log(
                  np.cosh(
                      np.arcsinh(y_float128 / multiplier) / tailweight
                      - skewness
                  )
                  / np.sqrt((y_float128 / multiplier) ** 2 + 1)
              )
              - np.log(tailweight)
              - np.log(multiplier),
              self.evaluate(
                  bijector.inverse_log_det_jacobian(y, event_ndims=0)
              ),
              rtol=1e-4,
              atol=0.0,
          )
      self.assertAllClose(
          self.evaluate(
              -bijector.inverse_log_det_jacobian(y, event_ndims=0)
          ),
          self.evaluate(
              bijector.forward_log_det_jacobian(x, event_ndims=0)
          ),
          rtol=1e-4,
          atol=0.0,
      )
  
file_path: probability/tensorflow_probability/python/bijectors/sinh_arcsinh_test.py
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.bijectors import sinh_arcsinh
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 9 for calling the SinhArcsinhTest obj's underlying member method code with example usage: obj.testBijectorOverRange(dtype) without return types