class_docstr: Trivial implementation of DataLoaderMapProviderBase.
  
  If a dataset returns batches from get_eval_batches(), then
  they will be what the corresponding dataloader returns,
  independently of any of the fields on this class.
  
  Otherwise, returns shuffled batches.
class_docstr_tok: ["Trivial","implementation","of","DataLoaderMapProviderBase",".","If","a","dataset","returns","batches","from","get_eval_batches","(",")",",","then","they","will","be","what","the","corresponding","dataloader","returns",",","independently","of","any","of","the","fields","on","this","class",".","Otherwise",",","returns","shuffled","batches","."]
docstr: Returns the dataloader for a dataset.
  
  Args:
      dataset: the dataset
      num_batches: possible ceiling on number of batches per epoch
docstr_tok: ["Returns","the","dataloader","for","a","dataset",".","Args",":","dataset",":","the","dataset","num_batches",":","possible","ceiling","on","number","of","batches","per","epoch"]
code: def _make_data_loader(
      self,
      dataset: Optional[DatasetBase],
      num_batches: int,
  ) -> Optional[DataLoader[FrameData]]:
      """
      Returns the dataloader for a dataset.
  
      Args:
          dataset: the dataset
          num_batches: possible ceiling on number of batches per epoch
      """
      if dataset is None:
          return None
  
      data_loader_kwargs = {
          "num_workers": self.num_workers,
          "collate_fn": dataset.frame_data_type.collate,
      }
  
      eval_batches = dataset.get_eval_batches()
      if eval_batches is not None:
          return DataLoader(
              dataset,
              batch_sampler=eval_batches,
              **data_loader_kwargs,
          )
  
      if num_batches > 0:
          num_samples = self.batch_size * num_batches
      else:
          num_samples = None
  
      # sample with replacement only if a custom number of samples is specified
      sampler = RandomSampler(
          dataset,
          replacement=num_samples is not None,
          num_samples=num_samples,
      )
  
      batch_sampler = BatchSampler(
          sampler, self.batch_size, drop_last=True
      )
      return DataLoader(
          dataset,
          batch_sampler=batch_sampler,
          **data_loader_kwargs,
      )
  
imports: from dataclasses import dataclass
  from enum import Enum
  from typing import Iterator, List, Optional, Tuple
  import torch
  from pytorch3d.implicitron.tools.config import registry, ReplaceableBase
  from torch.utils.data import BatchSampler, ConcatDataset, DataLoader, RandomSampler, Sampler
  from .dataset_base import DatasetBase
  from .dataset_map_provider import DatasetMap
  from .frame_data import FrameData
  from .scene_batch_sampler import SceneBatchSampler
  from .utils import is_known_frame_scalar
label_desc: Use image node_id 2 for calling the SimpleDataLoaderMapProvider obj's underlying member method code with example usage: obj._make_data_loader(dataset, num_batches) and returns: DataLoader, None, DataLoader