class_docstr: Base class for providers that combine multiple datasets.
class_docstr_tok: ["Base","class","for","providers","that","combine","multiple","datasets","."]
docstr: Constructor.
  
  Args:
    data_providers: A list of data_providers.
    batch_size_ratios: A list of ratios of batch sizes for each provider.
      These do not need to sum to 1. For example, [2, 1] will produce batches
      with a size ratio of 2 to 1.
code: def __init__(self, data_providers, batch_size_ratios=()):
      """Constructor.
  
      Args:
        data_providers: A list of data_providers.
        batch_size_ratios: A list of ratios of batch sizes for each provider.
          These do not need to sum to 1. For example, [2, 1] will produce batches
          with a size ratio of 2 to 1.
      """
      if batch_size_ratios:
          # Check lengths match.
          if len(batch_size_ratios) != len(data_providers):
              raise ValueError(
                  "List of batch size ratios ({}) must be of the same "
                  "length as the list of data providers ({}) for varying"
                  "batch sizes.".format(
                      len(batch_size_ratios), len(data_providers)
                  )
              )
          # Normalize the ratios.
          total = sum(batch_size_ratios)
          batch_size_ratios = [
              float(bsr) / total for bsr in batch_size_ratios
          ]
      else:
          # Sample evenly from each.
          batch_size_ratios = [1.0 for _ in data_providers]
  
      # Make sure all sample rates are the same.
      sample_rates = [dp.sample_rate for dp in data_providers]
      assert len(set(sample_rates)) <= 1
      sample_rate = sample_rates[0]
  
      # Make sure all frame rates are the same.
      frame_rates = [dp.frame_rate for dp in data_providers]
      assert len(set(frame_rates)) <= 1
      frame_rate = frame_rates[0]
  
      super().__init__(sample_rate, frame_rate)
      self._data_providers = data_providers
      self._batch_size_ratios = batch_size_ratios
  
imports: import os
  from absl import logging
  from ddsp.spectral_ops import CREPE_FRAME_SIZE
  from ddsp.spectral_ops import CREPE_SAMPLE_RATE
  from ddsp.spectral_ops import get_framed_lengths
  import gin
  import tensorflow.compat.v2
  import tensorflow_datasets
label_desc: Use image node_id 1 to create a new BaseMultiProvider object from inherited base classes: DataProvider with example: obj = BaseMultiProvider(data_providers, batch_size_ratios)