docstr: Instantiates a multi-tensor AdamW optimizer from a configuration.
  
  Args:
      config: A configuration for AdamWMT.
          See :func:`__init__` for parameters expected in the config.
  
  Returns:
      An AdamWMT instance.
docstr_tok: ["Instantiates","a","multi-tensor","AdamW","optimizer","from","a","configuration",".","Args",":","config",":","A","configuration","for","AdamWMT",".","See",":","func",":","`","__init__","`","for","parameters","expected","in","the","config",".","Returns",":","An","AdamWMT","instance","."]
code: def from_config(cls, config: Dict[str, Any]) -> "AdamWMT":
      """Instantiates a multi-tensor AdamW optimizer from a configuration.
  
      Args:
          config: A configuration for AdamWMT.
              See :func:`__init__` for parameters expected in the config.
  
      Returns:
          An AdamWMT instance.
      """
      # Default params
      config.setdefault("lr", 0.01)
      config.setdefault("betas", [0.9, 0.999])
      config.setdefault("eps", 1e-8)
      config.setdefault("weight_decay", 0.01)
      config.setdefault("amsgrad", False)
  
      # Check if betas is a list and convert it to a tuple
      # since a JSON config can only have lists
      if type(config["betas"]) == list:
          config["betas"] = tuple(config["betas"])
  
      assert (
          type(config["betas"]) == tuple
          and len(config["betas"]) == 2
          and type(config["betas"][0]) == float
          and type(config["betas"][1]) == float
          and config["betas"][0] >= 0.0
          and config["betas"][0] < 1.0
          and config["betas"][1] >= 0.0
          and config["betas"][1] < 1.0
      ), "Config must contain a tuple 'betas' in [0, 1) for AdamWMT optimizer"
  
      return cls(
          lr=config["lr"],
          betas=config["betas"],
          eps=config["eps"],
          weight_decay=config["weight_decay"],
          amsgrad=config["amsgrad"],
      )
  
file_path: ClassyVision/classy_vision/optim/adamw_mt.py
imports: from typing import Any, Dict, Tuple
  import torch.optim
  from .None import ClassyOptimizer, register_optimizer
label_desc: Use image node_id 3 for calling the AdamWMT obj's underlying member method code with example usage: obj.from_config(cls, config) and returns: cls