code: def test_differentialbe_barycentrics_close_to_rasterizer(
      self, rasterization_backend_type
  ):
      image_width = 32
      image_height = 32
  
      initial_vertices = tf.constant(
          [[[0, 0, 0], [0.5, 0, 0], [0.5, 0.5, 0]]], dtype=tf.float32
      )
      triangles = [[0, 1, 2]]
      view_projection_matrix = tf.expand_dims(tf.eye(4), axis=0)
  
      # Compute rasterization barycentrics
      rasterized = rasterization_backend.rasterize(
          initial_vertices,
          triangles,
          view_projection_matrix,
          (image_width, image_height),
          num_layers=1,
          backend=rasterization_backend_type,
      ).layer(0)
  
      ras_barycentrics = rasterized.barycentrics.value
  
      clip_space_vertices = utils.transform_homogeneous(
          view_projection_matrix, initial_vertices
      )
      rasterized_w_diff_barycentrics = (
          barycentrics.differentiable_barycentrics(
              rasterized, clip_space_vertices, triangles
          )
      )
      diff_barycentrics = (
          rasterized_w_diff_barycentrics.barycentrics.value
      )
  
      self.assertAllClose(
          ras_barycentrics, diff_barycentrics, rtol=1e-4
      )
  
file_path: graphics/tensorflow_graphics/rendering/tests/barycentrics_test.py
imports: from absl.testing import parameterized
  import tensorflow
  from tensorflow_graphics.rendering import barycentrics
  from tensorflow_graphics.rendering import rasterization_backend
  from tensorflow_graphics.rendering import utils
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 1 for calling the BarycentricsTest obj's underlying member method code with example usage: obj.test_differentialbe_barycentrics_close_to_rasterizer(rasterization_backend_type) without return types