code: def _load_optimizer_state(self):
      main_checkpoint = (
          find_resume_checkpoint() or self.resume_checkpoint
      )
      opt_checkpoint = bf.join(
          bf.dirname(main_checkpoint), f"opt{self.resume_step:06}.pt"
      )
      if bf.exists(opt_checkpoint):
          logger.log(
              f"loading optimizer state from checkpoint: {opt_checkpoint}"
          )
          state_dict = dist_util.load_state_dict(
              opt_checkpoint, map_location=dist_util.dev()
          )
          self.opt.load_state_dict(state_dict)
  
imports: import copy
  import functools
  import os
  import blobfile
  import numpy
  import torch
  import torch.distributed
  from torch.nn.parallel.distributed import DistributedDataParallel
  from torch.optim import AdamW
  from .None import dist_util, logger
  from .fp16_util import make_master_params, master_params_to_model_params, model_grads_to_master_grads, unflatten_master_params, zero_grad
  from .nn import update_ema
  from .resample import LossAwareSampler, UniformSampler
label_desc: Use image node_id 4 for calling the TrainLoop obj's underlying member method code with example usage: obj._load_optimizer_state() without return types