code: def weighted_sum(pointsidx, alphas, pt_clds) -> torch.Tensor:
      """
      Composite features within a z-buffer using normalized weighted sum.
  
      Args:
          pt_clds: Packed Tensor of shape (C, P) giving the features of each point
              (can use RGB for example).
          alphas: float32 Tensor of shape (N, points_per_pixel, image_size,
              image_size) giving the weight of each point in the z-buffer.
              Values should be in the interval [0, 1].
          pointsidx: int32 Tensor of shape (N, points_per_pixel, image_size, image_size)
              giving the indices of the nearest points at each pixel, sorted in z-order.
              Concretely pointsidx[n, k, y, x] = p means that features[:, p] is the
              feature of the kth closest point (along the z-direction) to pixel (y, x) in
              batch element n. This is weighted by alphas[n, k, y, x].
  
      Returns:
          Combined features: Tensor of shape (N, C, image_size, image_size)
              giving the accumulated features at each point.
      """
      return _CompositeWeightedSumPoints.apply(
          pt_clds, alphas, pointsidx
      )
  
file_path: pytorch3d/pytorch3d/renderer/compositing.py
imports: import torch
  from pytorch3d import _C
label_desc: Use image node_id 3 for calling a global function with example usage: weighted_sum(pointsidx, alphas, pt_clds) and returns: _CompositeWeightedSumPoints