class_docstr: Adapted from `improved_diffusion.train_util.TrainLoop`
  (https://github.com/openai/improved-diffusion)
  to remove MPI broadcasts for parameter loading.
class_docstr_tok: ["Adapted","from","`","improved_diffusion.train_util.TrainLoop","`","(","https",":","\/\/github.com\/openai\/improved-diffusion",")","to","remove","MPI","broadcasts","for","parameter","loading","."]
code: def _load_and_sync_parameters(self):
      if self.resume_checkpoint:
          self.resume_step = parse_resume_step_from_filename(
              self.resume_checkpoint
          )
          if dist.get_rank() == 0:
              logger.log(
                  f"loading model from checkpoint: {self.resume_checkpoint}..."
              )
              self.model.load_state_dict(
                  torch.load(
                      self.resume_checkpoint,
                      map_location=dist_util.dev(),
                  )
              )
  
      dist_util.sync_params(self.model.parameters())
  
imports: import copy
  import hashlib
  from pathlib import Path
  from typing import List, Set, Union
  import numpy
  import plotly.graph_objs
  import torch
  import torch.distributed
  import wandb
  from hydra.core.hydra_config import HydraConfig
  from hydra.utils import instantiate, to_absolute_path
  from improved_diffusion import dist_util
  from improved_diffusion import gaussian_diffusion
  from improved_diffusion import logger, respace, train_util
  from omegaconf import DictConfig, OmegaConf
label_desc: Use image node_id 1 for calling the TrainLoop obj's underlying member method code with example usage: obj._load_and_sync_parameters() without return types