class_docstr: Scatters points into voxels, used in the voxel encoder with dynamic
  voxelization.
  
  Note:
      The CPU and GPU implementation get the same output, but have numerical
      difference after summation and division (e.g., 5e-7).
  
  Args:
      voxel_size (list): list [x, y, z] size of three dimension.
      point_cloud_range (list): The coordinate range of points, [x_min,
          y_min, z_min, x_max, y_max, z_max].
      average_points (bool): whether to use avg pooling to scatter points
          into voxel.
class_docstr_tok: ["Scatters","points","into","voxels",",","used","in","the","voxel","encoder","with","dynamic","voxelization",".","Note",":","The","CPU","and","GPU","implementation","get","the","same","output",",","but","have","numerical","difference","after","summation","and","division","(","e.g.",",","5e-7",")",".","Args",":","voxel_size","(","list",")",":","list","[","x",",","y",",","z","]","size","of","three","dimension",".","point_cloud_range","(","list",")",":","The","coordinate","range","of","points",",","[","x_min",",","y_min",",","z_min",",","x_max",",","y_max",",","z_max","]",".","average_points","(","bool",")",":","whether","to","use","avg","pooling","to","scatter","points","into","voxel","."]
docstr: Scatters points/features into voxels.
  
  Args:
      points (torch.Tensor): Points to be reduced into voxels.
      coors (torch.Tensor): Corresponding voxel coordinates (specifically
          multi-dim voxel index) of each points.
  
  Returns:
      voxel_feats (torch.Tensor): Reduced features, input features that
          shares the same voxel coordinates are reduced to one row.
      voxel_coors (torch.Tensor): Voxel coordinates.
docstr_tok: ["Scatters","points\/features","into","voxels",".","Args",":","points","(","torch.Tensor",")",":","Points","to","be","reduced","into","voxels",".","coors","(","torch.Tensor",")",":","Corresponding","voxel","coordinates","(","specifically","multi-dim","voxel","index",")","of","each","points",".","Returns",":","voxel_feats","(","torch.Tensor",")",":","Reduced","features",",","input","features","that","shares","the","same","voxel","coordinates","are","reduced","to","one","row",".","voxel_coors","(","torch.Tensor",")",":","Voxel","coordinates","."]
code: def forward(self, points, coors):
      """Scatters points/features into voxels.
  
      Args:
          points (torch.Tensor): Points to be reduced into voxels.
          coors (torch.Tensor): Corresponding voxel coordinates (specifically
              multi-dim voxel index) of each points.
  
      Returns:
          voxel_feats (torch.Tensor): Reduced features, input features that
              shares the same voxel coordinates are reduced to one row.
          voxel_coors (torch.Tensor): Voxel coordinates.
      """
      if coors.size(-1) == 3:
          return self.forward_single(points, coors)
      else:
          batch_size = coors[-1, 0] + 1
          voxels, voxel_coors = [], []
          for i in range(batch_size):
              inds = torch.where(coors[:, 0] == i)
              voxel, voxel_coor = self.forward_single(
                  points[inds], coors[inds][:, 1:]
              )
              coor_pad = nn.functional.pad(
                  voxel_coor, (1, 0), mode="constant", value=i
              )
              voxel_coors.append(coor_pad)
              voxels.append(voxel)
          features = torch.cat(voxels, dim=0)
          feature_coors = torch.cat(voxel_coors, dim=0)
  
          return features, feature_coors
  
file_path: lavis/lavis/common/annotator/uniformer/mmcv/ops/scatter_points.py
imports: import torch
  from torch import nn
  from torch.autograd import Function
  from ..utils import ext_loader
label_desc: Use image node_id 3 for calling the DynamicScatter obj's underlying member method code with example usage: obj.forward(points, coors) and returns: self, features,  feature_coors