code: def interpolate_attributes(
      attribute: type_alias.TensorLike,
      barycentric: type_alias.TensorLike,
      name: str = "interpolate_attributes",
  ) -> tf.Tensor:
      """Interpolates attributes using barycentric weights.
  
      Note:
        In the following, A1 to An are optional batch dimensions.
  
      Args:
        attribute: A tensor of shape `[A1, ..., An, 3, B]`, where the last dimension
          stores a per-vertex `B`-dimensional attribute.
        barycentric: A tensor of shape `[A1, ..., An, 3]`, where the last dimension
          contains barycentric coordinates.
        name: A name for this op. Defaults to "interpolate_attributes".
  
      Returns:
        A tensor of shape `[A1, ..., An, B]`, containing interpolated attributes.
      """
      with tf.name_scope(name):
          attribute = tf.convert_to_tensor(value=attribute)
          barycentric = tf.convert_to_tensor(value=barycentric)
  
          shape.check_static(
              tensor=attribute,
              tensor_name="attribute",
              has_dim_equals=(-2, 3),
          )
          shape.check_static(
              tensor=barycentric,
              tensor_name="barycentric",
              has_dim_equals=(-1, 3),
          )
          shape.compare_batch_dimensions(
              tensors=(attribute, barycentric),
              last_axes=(-2, -1),
              tensor_names=("attribute", "barycentric"),
              broadcast_compatible=True,
          )
          barycentric = asserts.assert_normalized(barycentric, order=1)
          return tf.reduce_sum(
              input_tensor=tf.expand_dims(barycentric, axis=-1)
              * attribute,
              axis=-2,
          )
  
file_path: graphics/tensorflow_graphics/rendering/opengl/math.py
imports: from typing import Tuple
  import tensorflow
  from tensorflow_graphics.geometry.transformation import look_at
  from tensorflow_graphics.math.interpolation import weighted
  from tensorflow_graphics.rendering.camera import perspective
  from tensorflow_graphics.util import asserts
  from tensorflow_graphics.util import export_api
  from tensorflow_graphics.util import shape
  from tensorflow_graphics.util import type_alias
label_desc: Use image node_id 7 for calling a global function with example usage: interpolate_attributes(attribute, barycentric, name) and returns: tf