class_docstr: A classic batch object wrapper with :class:`Pair`. Used for Dense Pair Batch (ie pointcloud with fixed size).
      
class_docstr_tok: ["A","classic","batch","object","wrapper","with",":","class",":","`","Pair","`",".","Used","for","Dense","Pair","Batch","(","ie","pointcloud","with","fixed","size",")","."]
docstr: Constructs a batch object from a python list holding
  :class:`torch_geometric.data.Data` objects.
docstr_tok: ["Constructs","a","batch","object","from","a","python","list","holding",":","class",":","`","torch_geometric.data.Data","`","objects","."]
code: def from_data_list(data_list):
      r"""Constructs a batch object from a python list holding
      :class:`torch_geometric.data.Data` objects.
      """
      keys = [set(data.keys) for data in data_list]
      keys = list(set.union(*keys))
  
      # Check if all dimensions matches and we can concatenate data
      # if len(data_list) > 0:
      #    for data in data_list[1:]:
      #        for key in keys:
      #            assert data_list[0][key].shape == data[key].shape
  
      batch = DensePairBatch()
      batch.__data_class__ = data_list[0].__class__
  
      for key in keys:
          batch[key] = []
  
      for _, data in enumerate(data_list):
          for key in data.keys:
              item = data[key]
              batch[key].append(item)
  
      for key in batch.keys:
          item = batch[key][0]
          if (
              torch.is_tensor(item)
              or isinstance(item, int)
              or isinstance(item, float)
          ):
              if key != "pair_ind":
                  batch[key] = torch.stack(batch[key])
          else:
              raise ValueError("Unsupported attribute type")
      # add pair_ind for dense data too
      if hasattr(data_list[0], "pair_ind"):
          pair_ind = concatenate_pair_ind(data_list, data_list).to(
              torch.long
          )
      else:
          pair_ind = None
      batch.pair_ind = pair_ind
      return batch.contiguous()
  
imports: import torch
  from typing import List, Optional
  from torch_geometric.data import Data
  from torch_geometric.data import Batch
  from torch_points3d.datasets.multiscale_data import MultiScaleBatch, MultiScaleData
  import re
label_desc: Use image node_id 2 for calling the DensePairBatch obj's underlying member method code with example usage: obj.from_data_list(data_list) and returns: batch