docstr: Instantiates a CompositeParamScheduler from a configuration.
  
  Args:
      config: A configuration for a CompositeParamScheduler.
          See :func:`__init__` for parameters expected in the config.
  
  Returns:
      A CompositeParamScheduler instance.
code: def from_config(
      cls, config: Dict[str, Any]
  ) -> "CompositeParamScheduler":
      """Instantiates a CompositeParamScheduler from a configuration.
  
      Args:
          config: A configuration for a CompositeParamScheduler.
              See :func:`__init__` for parameters expected in the config.
  
      Returns:
          A CompositeParamScheduler instance.
      """
      assert (
          "schedulers" in config and "lengths" in config
      ), "Composite scheduler needs both a list of schedulers and lengths"
      interval_scaling = []
      if "interval_scaling" in config:
          assert len(config["schedulers"]) == len(
              config["interval_scaling"]
          ), "Schedulers and interval scaling must be the same length"
          for interval_scale in config["interval_scaling"]:
              assert interval_scale in {
                  "fixed",
                  "rescaled",
              }, "Choices for interval scaling are 'fixed' or 'rescaled'"
              interval_scaling.append(
                  IntervalScaling[interval_scale.upper()]
              )
      else:
          interval_scaling = [IntervalScaling.RESCALED] * len(
              config["schedulers"]
          )
      if (
          "num_epochs" in config
      ):  # Propagate value to intermediate schedulers
          config["schedulers"] = [
              dict(schedule, **{"num_epochs": config["num_epochs"]})
              for schedule in config["schedulers"]
          ]
      return cls(
          schedulers=[
              build_param_scheduler(scheduler)
              for scheduler in config["schedulers"]
          ],
          lengths=config["lengths"],
          update_interval=UpdateInterval.from_config(
              config, UpdateInterval.STEP
          ),
          interval_scaling=interval_scaling,
      )
  
file_path: ClassyVision/classy_vision/optim/param_scheduler/composite_scheduler.py
imports: from enum import auto, Enum
  from typing import Any, Dict, Sequence, Union
  from fvcore.common import param_scheduler
  from .None import build_param_scheduler, register_param_scheduler, UpdateInterval
label_desc: Use image node_id 2 for calling the CompositeParamScheduler obj's underlying member method code with example usage: obj.from_config(cls, config) and returns: cls