docstr: Tests that the exceptions are raised correctly.
docstr_tok: ["Tests","that","the","exceptions","are","raised","correctly","."]
code: def test_brdf_exceptions_raised(self):
      """Tests that the exceptions are raised correctly."""
      direction_incoming_light = np.random.uniform(-1.0, 1.0, size=(3,))
      direction_outgoing_light = np.random.uniform(-1.0, 1.0, size=(3,))
      surface_normal = np.random.uniform(-1.0, 1.0, size=(3,))
      shininess = np.random.uniform(0.0, 1.0, size=(1,))
      albedo = np.random.uniform(0.0, 1.0, (3,))
  
      with self.subTest(
          name="assert_on_direction_incoming_light_not_normalized"
      ):
          with self.assertRaises(tf.errors.InvalidArgumentError):
              self.evaluate(
                  blinn_phong.brdf(
                      direction_incoming_light,
                      direction_outgoing_light,
                      surface_normal,
                      shininess,
                      albedo,
                  )
              )
  
      direction_incoming_light /= np.linalg.norm(
          direction_incoming_light, axis=-1
      )
      with self.subTest(
          name="assert_on_direction_outgoing_light_not_normalized"
      ):
          with self.assertRaises(tf.errors.InvalidArgumentError):
              self.evaluate(
                  blinn_phong.brdf(
                      direction_incoming_light,
                      direction_outgoing_light,
                      surface_normal,
                      shininess,
                      albedo,
                  )
              )
  
      direction_outgoing_light /= np.linalg.norm(
          direction_outgoing_light, axis=-1
      )
      with self.subTest(name="assert_on_surface_normal_not_normalized"):
          with self.assertRaises(tf.errors.InvalidArgumentError):
              self.evaluate(
                  blinn_phong.brdf(
                      direction_incoming_light,
                      direction_outgoing_light,
                      surface_normal,
                      shininess,
                      albedo,
                  )
              )
  
      surface_normal /= np.linalg.norm(surface_normal, axis=-1)
      with self.subTest(name="assert_on_albedo_not_normalized"):
          albedo = np.random.uniform(
              -10.0, -sys.float_info.epsilon, (3,)
          )
          with self.assertRaises(tf.errors.InvalidArgumentError):
              self.evaluate(
                  blinn_phong.brdf(
                      direction_incoming_light,
                      direction_outgoing_light,
                      surface_normal,
                      shininess,
                      albedo,
                  )
              )
  
          albedo = np.random.uniform(sys.float_info.epsilon, 10.0, (3,))
          with self.assertRaises(tf.errors.InvalidArgumentError):
              self.evaluate(
                  blinn_phong.brdf(
                      direction_incoming_light,
                      direction_outgoing_light,
                      surface_normal,
                      shininess,
                      albedo,
                  )
              )
  
file_path: graphics/tensorflow_graphics/rendering/reflectance/tests/blinn_phong_test.py
imports: import math
  import sys
  from absl.testing import flagsaver
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_graphics.rendering.reflectance import blinn_phong
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 4 for calling the BlinnPhongTest obj's underlying member method code with example usage: obj.test_brdf_exceptions_raised() without return types