class_docstr: wandb sweep.
  
  Args:
      config (DictConfig): Original model configuration.
      sweep_config (DictConfig): Sweep configuration.
      entity (str, optional): Username or workspace to send the project to. Defaults to None.
class_docstr_tok: ["wandb","sweep",".","Args",":","config","(","DictConfig",")",":","Original","model","configuration",".","sweep_config","(","DictConfig",")",":","Sweep","configuration",".","entity","(","str",",","optional",")",":","Username","or","workspace","to","send","the","project","to",".","Defaults","to","None","."]
docstr: Method to load the model, update config and call fit. The metrics are logged to ```wandb``` dashboard.
docstr_tok: ["Method","to","load","the","model",",","update","config","and","call","fit",".","The","metrics","are","logged","to","``","`","wandb","``","`","dashboard","."]
code: def sweep(self) -> None:
      """Method to load the model, update config and call fit. The metrics are logged to ```wandb``` dashboard."""
      wandb_logger = WandbLogger(
          config=flatten_sweep_params(self.sweep_config),
          log_model=False,
      )
      sweep_config = wandb_logger.experiment.config
  
      for param in sweep_config.keys():
          set_in_nested_config(
              self.config, param.split("."), sweep_config[param]
          )
      config = update_input_size_config(self.config)
  
      model = get_model(config)
      datamodule = get_datamodule(config)
      callbacks = get_sweep_callbacks(config)
  
      # Disable saving checkpoints as all checkpoints from the sweep will get uploaded
      config.trainer.enable_checkpointing = False
  
      trainer = pl.Trainer(
          **config.trainer, logger=wandb_logger, callbacks=callbacks
      )
      trainer.fit(model, datamodule=datamodule)
  
      del model
      gc.collect()
      torch.cuda.empty_cache()
  
imports: from __future__ import annotations
  import gc
  import pytorch_lightning
  import torch
  import wandb
  from comet_ml import Optimizer
  from omegaconf import DictConfig, ListConfig, OmegaConf
  from pytorch_lightning.loggers import CometLogger, WandbLogger
  from anomalib.config import update_input_size_config
  from anomalib.data import get_datamodule
  from anomalib.models import get_model
  from anomalib.utils.sweep import flatten_sweep_params, get_sweep_callbacks, set_in_nested_config
  from .config import flatten_hpo_params
label_desc: Use image node_id 3 for calling the WandbSweep obj's underlying member method code with example usage: obj.sweep() without return types