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 testPowerOddInteger(self):
      power = np.array([3.0, -5.0, 5.0, -7.0]).reshape((4, 1))
      bijector = power_lib.Power(power=power, validate_args=True)
      self.assertStartsWith(bijector.name, "power")
      x = np.linspace(-10.0, 10.0, 20)
      y = np.power(x, power)
      ildj = -np.log(np.abs(power)) - (power - 1.0) * np.log(np.abs(x))
      self.assertAllClose(y, self.evaluate(bijector.forward(x)))
      self.assertAllClose(
          x * np.ones((4, 1)), 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 4 for calling the RaiseBijectorTest obj's underlying member method code with example usage: obj.testPowerOddInteger() without return types