docstr: Tests that undistortion_factor produces the expected outputs.
docstr_tok: ["Tests","that","undistortion_factor","produces","the","expected","outputs","."]
code: def test_undistortion_factor_random_positive_distortion_coefficient(
      self, num_iterations, tolerance
  ):
      """Tests that undistortion_factor produces the expected outputs."""
      distorted_squared_radii = _get_random_radii() * 2.0
      distortion_coefficient = _get_random_coefficient() * 0.2
  
      (
          undistortion,
          mask,
      ) = quadratic_radial_distortion.undistortion_factor(
          distorted_squared_radii,
          distortion_coefficient,
          num_iterations,
      )
      distortion_coefficient = _make_shape_compatible(
          distortion_coefficient
      )
      undistorted_squared_radii = (
          tf.square(undistortion) * distorted_squared_radii
      )
      # We distort again the undistorted radii and compare to the original
      # distorted_squared_radii.
      redistorted_squared_radii = (
          tf.square(
              1.0 + distortion_coefficient * undistorted_squared_radii
          )
          * undistorted_squared_radii
      )
  
      with self.subTest(name="distortion"):
          self.assertAllClose(
              distorted_squared_radii,
              redistorted_squared_radii,
              atol=tolerance,
          )
  
      # Positive distortion_coefficients never overflow.
      with self.subTest(name="mask"):
          self.assertAllInSet(mask, (False,))
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_graphics.rendering.camera import quadratic_radial_distortion
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 6 for calling the QuadraticRadialDistortionTest obj's underlying member method code with example usage: obj.test_undistortion_factor_random_positive_distortion_coefficient(num_iterations, tolerance) without return types