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 _infer_dataset_probabilities(self):
      from mmf.utils.configuration import get_global_config
  
      training = get_global_config("training")
  
      proportional_sampling = training.get(
          "dataset_size_proportional_sampling", True
      )
  
      if proportional_sampling is True:
          strategy = (
              iteration_strategies.SizeProportionalIterationStrategy
          )
          self._iteration_strategy = strategy(
              OmegaConf.create(), self.loaders
          )
      else:
          self._iteration_strategy = (
              iteration_strategies.RandomIterationStrategy(
                  OmegaConf.create(), self.loaders
              )
          )
  
      multitasking = get_global_config("multitasking")
      multitasking_enabled = multitasking.get("enabled", False)
  
      assert (
          proportional_sampling is True
          or training.get("max_epochs", None) is None
      ), "Epoch based training can only be used with size proportional sampling"
  
      assert not (proportional_sampling and multitasking_enabled), (
          "Multitasking (manually-specified) per-dataset ratios cannot be used "
          "with size proportional sampling"
      )
  
      if multitasking_enabled and "sampling_ratios" in multitasking:
          self._iteration_strategy = iteration_strategies.RatiosIterationStrategy(
              OmegaConf.create(
                  {
                      "sampling_ratios": multitasking.sampling_ratios,
                      "datasets": self._given_datasets,
                  }
              ),
              self._loaders,
          )
      elif proportional_sampling is True:
          strategy = (
              iteration_strategies.SizeProportionalIterationStrategy
          )
          self._iteration_strategy = strategy(
              OmegaConf.create(), self.loaders
          )
      else:
          self._iteration_strategy = (
              iteration_strategies.RandomIterationStrategy(
                  OmegaConf.create(), self.loaders
              )
          )
  
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 8 for calling the MultiDatasetLoader obj's underlying member method code with example usage: obj._infer_dataset_probabilities() without return types