class_docstr: MultiDatasetLoader class that is used for training on multiple datasets together.
class_docstr_tok: ["MultiDatasetLoader","class","that","is","used","for","training","on","multiple","datasets","together","."]
code: def build_datasets(self, config):
      self._datasets = []
      self.config = config
      self._given_datasets = dataset_list_from_config(self.config)
  
      for dataset in self._given_datasets:
          if dataset in self.config.dataset_config:
              dataset_config = self.config.dataset_config[dataset]
          else:
              warnings.warn(
                  f"Dataset {dataset} is missing from dataset_config"
                  + " in config. Proceeding with empty config."
              )
              dataset_config = OmegaConf.create()
  
          dataset_instance = build_dataset(
              dataset, dataset_config, self.dataset_type
          )
          if dataset_instance is None:
              continue
          self.datasets.append(dataset_instance)
          self.dataset_list.append(dataset)
  
      self._num_datasets = len(self.datasets)
      self.current_index = 0
  
      self._infer_dataset_probabilities()
  
imports: import logging
  import warnings
  from typing import Dict, Iterator
  import torch
  from mmf.common.sample import convert_batch_to_sample_list, SampleList
  from mmf.datasets import iteration_strategies
  from mmf.utils.build import build_dataloader_and_sampler, build_dataset
  from mmf.utils.dataset import dataset_list_from_config
  from mmf.utils.distributed import broadcast_scalar, get_world_size, is_dist_initialized, is_main, is_xla
  from mmf.utils.general import get_batch_size, get_current_device
  from omegaconf import OmegaConf
  from torch.utils.data.dataloader import DataLoader, Sampler
label_desc: Use image node_id 5 for calling the MultiDatasetLoader obj's underlying member method code with example usage: obj.build_datasets(config) without return types