class_docstr: Standard solver for AudioCraft.
  
  The standard solver implements a base training loop with the following stages:
  train, valid, evaluate and generate that are expected to be all defined for
  solvers in AudioCraft. It also provides a nice default management of Dora history replay,
  checkpoint management across epoch, and logging configuration.
  
  AudioCraft solvers must inherit from the StandardSolver and define the methods
  associated to each stage as well as the show, build_model and build_dataloaders methods.
class_docstr_tok: ["Standard","solver","for","AudioCraft",".","The","standard","solver","implements","a","base","training","loop","with","the","following","stages",":","train",",","valid",",","evaluate","and","generate","that","are","expected","to","be","all","defined","for","solvers","in","AudioCraft",".","It","also","provides","a","nice","default","management","of","Dora","history","replay",",","checkpoint","management","across","epoch",",","and","logging","configuration",".","AudioCraft","solvers","must","inherit","from","the","StandardSolver","and","define","the","methods","associated","to","each","stage","as","well","as","the","show",",","build_model","and","build_dataloaders","methods","."]
docstr: Convenient autocast (or not) using the solver configuration.
docstr_tok: ["Convenient","autocast","(","or","not",")","using","the","solver","configuration","."]
code: def autocast(self):
      """Convenient autocast (or not) using the solver configuration."""
      return TorchAutocast(
          enabled=self.cfg.autocast,
          device_type=self.device,
          dtype=self.autocast_dtype,
      )
  
imports: from abc import ABC, abstractmethod
  from contextlib import contextmanager
  from pathlib import Path
  import typing
  import flashy
  import omegaconf
  import torch
  from torch import nn
  from ..None import optim
  from ..optim import fsdp
  from ..utils import checkpoint
  from ..utils.autocast import TorchAutocast
  from ..utils.best_state import BestStateDictManager
  from ..utils.deadlock import DeadlockDetect
  from ..utils.profiler import Profiler
  from ..utils.utils import copy_state, dict_from_config, model_hash, with_rank_rng
label_desc: Use image node_id 2 for calling the StandardSolver obj's underlying member method code with example usage: obj.autocast() and returns: TorchAutocast