code: def ray_sample_voxel_grid(ray_points, voxels, w2v_alpha, w2v_beta):
      """Estimates the voxel value at the ray points using trilinear interpolation.
  
      Args:
        ray_points: A tensor of shape `[B, M, N, 3]` where B is the batch size,
          M is the number of rays and N the samples along the ray.
        voxels: A tensor of shape `[B, H, W, D, C]`, where B is the batch size, H,
          W, D is height, width and depth of the voxel grid and C is the number
          of channels.
        w2v_alpha: A tensor of shape `[B, 3]` where B the batch size.
        w2v_beta: A tensor of shape `[B, 3]` where B the batch size.
  
      Returns:
        A tensor of shape `[B, M, N, C]`
      """
      w2v_alpha = utils.match_intermediate_batch_dimensions(
          w2v_alpha, ray_points
      )
      w2v_beta = utils.match_intermediate_batch_dimensions(
          w2v_beta, ray_points
      )
      rays = w2v_alpha * ray_points + w2v_beta
  
      batch_size = tf.shape(voxels)[0]
      channels = tf.shape(voxels)[-1]
      target_shape = tf.concat(
          [tf.shape(rays)[:-1], [channels]], axis=-1
      )
      rays = tf.reshape(rays, [batch_size, -1, 3])
      features_alpha = trilinear.interpolate(voxels, rays)
      return tf.reshape(features_alpha, target_shape)
  
imports: import numpy
  import tensorflow
  from tensorflow_graphics.math.interpolation import trilinear
  import tensorflow_graphics.projects.radiance_fields.utils
label_desc: Use image node_id 3 for calling a global function with example usage: ray_sample_voxel_grid(ray_points, voxels, w2v_alpha, w2v_beta) and returns: tf