code: def _load_from_pytorch(self, filename, ctx=None):
      import torch
      from mxnet import nd
  
      loaded = torch.load(filename)
      params = self._collect_params_with_prefix()
  
      new_params = {}
  
      for name in loaded:
          if (
              "bn" in name
              or "batchnorm" in name
              or ".downsample.1." in name
          ):
              if "weight" in name:
                  mxnet_name = name.replace("weight", "gamma")
              elif "bias" in name:
                  mxnet_name = name.replace("bias", "beta")
              else:
                  mxnet_name = name
              new_params[mxnet_name] = nd.array(
                  loaded[name].cpu().data.numpy()
              )
          else:
              new_params[name] = nd.array(
                  loaded[name].cpu().data.numpy()
              )
  
      for name in new_params:
          if name not in params:
              print("==={}===".format(name))
              raise Exception
          if name in params:
              params[name]._load_init(new_params[name], ctx=ctx)
  
file_path: gluon-cv/gluoncv/model_zoo/alpha_pose/utils.py
imports: from mxnet import random
  from mxnet import ndarray
  from mxnet.initializer import Initializer
label_desc: Use image node_id 2 for calling a global function with example usage: _load_from_pytorch(filename, ctx) without return types