class_docstr: WandB logger to manage logging of experiments
  parameters, metrics update, models log, gradient
  values and other information. The logger will log
  all run into the same experiment.
  
  Args:
      name(str): Display name for the run.
      group (Optional[str]): Specify a group to organize individual runs into a larger experiment
      config (Optional[Dict]): A dictionary summarizing the configuration
          related to the current run.
      save_dir(str): Path where data is saved (wandb dir by default).
      offline(bool): Run logger offline to later stream data to a remote server.
      id(str): Sets the version, mainly used to resume a previous run.
      version(str): Same as id.
      anonymous(bool): Enables or explicitly disables anonymous logging.
      project(str): The project's name to which this run will belong.
      experiment: WandB run to use instead of creating a new one. The other WandB's configuration
          parameters will be ignored.
      batch_granularity(bool): Whether to also output the result of each batch in addition to the epochs.
          (Default value = False).
      checkpoints_path (Optional[str]): A path leading to the checkpoint saving directory.
          You need to specify this argument to log the model checkpoints at the end of the training phase.
      initial_artifacts_paths (Optional[List[str]]): a list of paths leading to artifacts
          to be logged before the start of the training.
      log_gradient_frequency(int): log gradients and parameters every N batches (Default value = None).
      training_batch_shape(tuples): Shape of a training batch. Used for logging architecture on wandb.
  
  Example:
      .. code-block:: python
  
          wandb_logger = pt.WandBLogger(name="A run", project="A project")
          config_dict = {"Optimizer": "sgd", "Loss": "Cross-Entropy", "lr": 0.01}
          wandb_logger.log_config_params(config_params=config_dict)  # logging the config dictionary
          # our Poutyne experiment
          experiment = pt.Experiment(
              directory="a/path",
              network=network,
              device="cpu",
              optimizer="sgd",
              loss_function="cross_entropy",
              batch_metrics=["accuracy"],
          )
          # Using the WandB logger callback during training
          experiment.train(
              train_generator=train_loader, valid_generator=valid_loader, epochs=2, seed=42, callbacks=[wandb_logger]
          )
          # You can access the wandb run via the attribute .run if you want to use other wandb features
          image = wandb.Image('a/image.png', caption="a caption")
          wandb_logger.run.log({"My image": image})
  
          wandb.finish()  # Call once your finished with your experiment.
class_docstr_tok: ["WandB","logger","to","manage","logging","of","experiments","parameters",",","metrics","update",",","models","log",",","gradient","values","and","other","information",".","The","logger","will","log","all","run","into","the","same","experiment",".","Args",":","name","(","str",")",":","Display","name","for","the","run",".","group","(","Optional","[","str","]",")",":","Specify","a","group","to","organize","individual","runs","into","a","larger","experiment","config","(","Optional","[","Dict","]",")",":","A","dictionary","summarizing","the","configuration","related","to","the","current","run",".","save_dir","(","str",")",":","Path","where","data","is","saved","(","wandb","dir","by","default",")",".","offline","(","bool",")",":","Run","logger","offline","to","later","stream","data","to","a","remote","server",".","id","(","str",")",":","Sets","the","version",",","mainly","used","to","resume","a","previous","run",".","version","(","str",")",":","Same","as","id",".","anonymous","(","bool",")",":","Enables","or","explicitly","disables","anonymous","logging",".","project","(","str",")",":","The","project","'s","name","to","which","this","run","will","belong",".","experiment",":","WandB","run","to","use","instead","of","creating","a","new","one",".","The","other","WandB","'s","configuration","parameters","will","be","ignored",".","batch_granularity","(","bool",")",":","Whether","to","also","output","the","result","of","each","batch","in","addition","to","the","epochs",".","(","Default","value","=","False",")",".","checkpoints_path","(","Optional","[","str","]",")",":","A","path","leading","to","the","checkpoint","saving","directory",".","You","need","to","specify","this","argument","to","log","the","model","checkpoints","at","the","end","of","the","training","phase",".","initial_artifacts_paths","(","Optional","[","List","[","str","]","]",")",":","a","list","of","paths","leading","to","artifacts","to","be","logged","before","the","start","of","the","training",".","log_gradient_frequency","(","int",")",":","log","gradients","and","parameters","every","N","batches","(","Default","value","=","None",")",".","training_batch_shape","(","tuples",")",":","Shape","of","a","training","batch",".","Used","for","logging","architecture","on","wandb",".","Example",":","..","code-block",":",":","python","wandb_logger","=","pt.WandBLogger","(","name=","''","A","run","''",",","project=","''","A","project","''",")","config_dict","=","{","``","Optimizer","''",":","``","sgd","''",",","``","Loss","''",":","``","Cross-Entropy","''",",","``","lr","''",":","0.01","}","wandb_logger.log_config_params","(","config_params=config_dict",")","#","logging","the","config","dictionary","#","our","Poutyne","experiment","experiment","=","pt.Experiment","(","directory=","''","a\/path","''",",","network=network",",","device=","''","cpu","''",",","optimizer=","''","sgd","''",",","loss_function=","''","cross_entropy","''",",","batch_metrics=","[","``","accuracy","''","]",",",")","#","Using","the","WandB","logger","callback","during","training","experiment.train","(","train_generator=train_loader",",","valid_generator=valid_loader",",","epochs=2",",","seed=42",",","callbacks=","[","wandb_logger","]",")","#","You","can","access","the","wandb","run","via","the","attribute",".run","if","you","want","to","use","other","wandb","features","image","=","wandb.Image","(","'","a\/image.png","'",",","caption=","''","a","caption","''",")","wandb_logger.run.log","(","{","``","My","image","''",":","image","}",")","wandb.finish","(",")","#","Call","once","your","finished","with","your","experiment","."]
docstr: Save architecture.
docstr_tok: ["Save","architecture","."]
code: def _save_architecture(self) -> None:
      """
      Save architecture.
      """
      device = self.model.device
      dummies_batch = torch.randn(self.training_batch_shape).to(device)
      save_path = self.run.dir + "/" + self.run.name + "_model.onnx"
      torch.onnx.export(self.model.network, dummies_batch, save_path)
      self.run.save(save_path)
  
file_path: poutyne/poutyne/framework/callbacks/wandb_logger.py
imports: import os
  import warnings
  from typing import Dict, List, Optional
  import torch
  from poutyne.framework.callbacks.logger import Logger
label_desc: Use image node_id 3 for calling the WandBLogger obj's underlying member method code with example usage: obj._save_architecture() without return types