docstr: Tests that distortion_factor produces the expected outputs.
docstr_tok: ["Tests","that","distortion_factor","produces","the","expected","outputs","."]
code: def test_distortion_factor_random_negative_distortion_coefficient(
      self,
  ):
      """Tests that distortion_factor produces the expected outputs."""
      squared_radii = _get_random_radii() * 2.0
      distortion_coefficient = _get_random_coefficient() * -0.2
  
      distortion, mask = quadratic_radial_distortion.distortion_factor(
          squared_radii, distortion_coefficient
      )
      distortion_coefficient = _make_shape_compatible(
          distortion_coefficient
      )
      max_squared_radii = -1.0 / 3.0 / distortion_coefficient
      expected_overflow_mask = squared_radii > max_squared_radii
      valid_mask = np.logical_not(expected_overflow_mask)
      # We assert correctness of the mask, and of all the pixels that are not in
      # overflow.
      actual_distortion_when_valid = self.evaluate(distortion)[
          valid_mask
      ]
      expected_distortion_when_valid = (
          1.0 + distortion_coefficient * squared_radii
      )[valid_mask]
  
      with self.subTest(name="distortion"):
          self.assertAllClose(
              expected_distortion_when_valid,
              actual_distortion_when_valid,
          )
  
      with self.subTest(name="mask"):
          self.assertAllEqual(expected_overflow_mask, mask)
  
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 3 for calling the QuadraticRadialDistortionTest obj's underlying member method code with example usage: obj.test_distortion_factor_random_negative_distortion_coefficient() without return types