code: def parse_torch_weights(weights_path, move_rules=None):
      try:
          import torch
          import torch.nn as nn
          import torch.nn.functional as F
      except ImportError:
          torch = None
      assert (
          torch is not None
      ), "`get_values_from_torch_file` requires `torch`."
  
      model = torch.load(weights_path)
      names = list(model.keys())
      if move_rules is not None:
          if isinstance(move_rules, list):
              for name, loc in move_rules:
                  idx = names.index(name)
                  names.insert(idx + loc, names.pop(idx))
  
      if not tf_later_than("1.4"):
          for i, name in enumerate(names):
              if "running_mean" in str(name):
                  names[i - 1], names[i - 2] = (
                      names[i - 2],
                      names[i - 1],
                  )
  
      values = []
      for name in names:
          val = model[name].numpy()
          if val.ndim == 4:
              val = np.transpose(val, [2, 3, 1, 0])
          if val.ndim == 2:
              val = np.transpose(val, [1, 0])
          if val.ndim == 4:
              groups = val.shape[3] // val.shape[2]
              if (groups == 32) or (groups == 64):
                  values += np.split(val, groups, axis=3)
              else:
                  values.append(val)
          else:
              values.append(val)
  
      return values
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  import warnings
  from contextlib import contextmanager
  from .version_utils import tf_later_than
label_desc: Use image node_id 26 for calling a global function with example usage: parse_torch_weights(weights_path, move_rules) and returns: values