class_docstr: Tests the correctness of the Y = X ** K transformation.
class_docstr_tok: ["Tests","the","correctness","of","the","Y","=","X","*","*","K","transformation","."]
code: def testBijectorScalar(self):
      power = np.array([2.6, 0.3, -1.1])
      bijector = power_lib.Power(power=power, validate_args=True)
      self.assertStartsWith(bijector.name, "power")
      x = np.array(
          [
              [[1.0, 5.0, 3.0], [2.0, 1.0, 7.0]],
              [[np.sqrt(2.0), 3.0, 1.0], [np.sqrt(8.0), 1.0, 0.4]],
          ]
      )
      y = np.power(x, power)
      ildj = -np.log(np.abs(power)) - (power - 1.0) * np.log(x)
      self.assertAllClose(y, self.evaluate(bijector.forward(x)))
      self.assertAllClose(x, self.evaluate(bijector.inverse(y)))
      self.assertAllClose(
          ildj,
          self.evaluate(
              bijector.inverse_log_det_jacobian(y, event_ndims=0)
          ),
          atol=0.0,
          rtol=1e-6,
      )
      self.assertAllClose(
          self.evaluate(
              -bijector.inverse_log_det_jacobian(y, event_ndims=0)
          ),
          self.evaluate(
              bijector.forward_log_det_jacobian(x, event_ndims=0)
          ),
          atol=0.0,
          rtol=1e-7,
      )
  
file_path: probability/tensorflow_probability/python/bijectors/power_test.py
imports: from absl.testing import parameterized
  import numpy
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.bijectors import power
  from tensorflow_probability.python.bijectors import reciprocal
  from tensorflow_probability.python.bijectors import square
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 1 for calling the RaiseBijectorTest obj's underlying member method code with example usage: obj.testBijectorScalar() without return types