docstr: Constructs a batch object from a python list holding
  :class:`torch_geometric.data.Data` objects.
  The assignment vector :obj:`batch` is created on the fly.
  Additionally, creates assignment batch vectors for each key in
  :obj:`follow_batch`.
docstr_tok: ["Constructs","a","batch","object","from","a","python","list","holding",":","class",":","`","torch_geometric.data.Data","`","objects",".","The","assignment","vector",":","obj",":","`","batch","`","is","created","on","the","fly",".","Additionally",",","creates","assignment","batch","vectors","for","each","key","in",":","obj",":","`","follow_batch","`","."]
code: def from_data_list(data_list, follow_batch=[]):
      r"""Constructs a batch object from a python list holding
      :class:`torch_geometric.data.Data` objects.
      The assignment vector :obj:`batch` is created on the fly.
      Additionally, creates assignment batch vectors for each key in
      :obj:`follow_batch`."""
      for data in data_list:
          assert isinstance(data, MultiScaleData)
      num_scales = data_list[0].num_scales
      for data_entry in data_list:
          assert (
              data_entry.num_scales == num_scales
          ), "All data objects should contain the same number of scales"
      num_upsample = data_list[0].num_upsample
      for data_entry in data_list:
          assert (
              data_entry.num_upsample == num_upsample
          ), "All data objects should contain the same number of scales"
  
      # Build multiscale batches
      multiscale = []
      for scale in range(num_scales):
          ms_scale = []
          for data_entry in data_list:
              ms_scale.append(data_entry.multiscale[scale])
          multiscale.append(from_data_list_token(ms_scale))
  
      # Build upsample batches
      upsample = []
      for scale in range(num_upsample):
          upsample_scale = []
          for data_entry in data_list:
              upsample_scale.append(data_entry.upsample[scale])
          upsample.append(from_data_list_token(upsample_scale))
  
      # Create batch from non multiscale data
      for data_entry in data_list:
          del data_entry.multiscale
          del data_entry.upsample
      batch = Batch.from_data_list(data_list)
      batch = MultiScaleBatch.from_data(batch)
      batch.multiscale = multiscale
      batch.upsample = upsample
  
      if torch_geometric.is_debug_enabled():
          batch.debug()
  
      return batch
  
file_path: torch-points3d/torch_points3d/datasets/multiscale_data.py
imports: from typing import List, Optional
  import torch
  import copy
  import torch_geometric
  from torch_geometric.data import Data
  from torch_geometric.data import Batch
label_desc: Use image node_id 1 for calling the MultiScaleBatch obj's underlying member method code with example usage: obj.from_data_list(data_list, follow_batch) and returns: batch