code: def load_torch_weights(model, weights_path):
      import torch
  
      pretrained = torch.load(
          weights_path, map_location=torch.device("cpu")
      )
      layer_names = list(
          set(
              ".".join(k.split(".")[1:-1])
              for k in pretrained.keys()
              if k.split(".")[-1] != "num_batches_tracked"
          )
      )
      for layer_name in layer_names:
          try:
              layer = model.get_layer(layer_name)
          except Exception:  # pylint: disable=broad-except
              print("Skipping", layer.name)
              continue
          if isinstance(layer, keras.layers.BatchNormalization):
              gamma, beta, running_mean, running_std = [
                  pretrained[k].numpy()
                  for k in [
                      f"module.{layer_name}.weight",
                      f"module.{layer_name}.bias",
                      f"module.{layer_name}.running_mean",
                      f"module.{layer_name}.running_var",
                  ]
              ]
              layer.set_weights(
                  [gamma, beta, running_mean, running_std]
              )
          elif isinstance(layer, keras.layers.Conv2D):
              weights, bias = [
                  pretrained[k].numpy()
                  for k in [
                      f"module.{layer_name}.weight",
                      f"module.{layer_name}.bias",
                  ]
              ]
              layer.set_weights([weights.transpose(2, 3, 1, 0), bias])
  
          else:
              raise NotImplementedError
  
      for layer in model.layers:
          if isinstance(
              layer,
              (keras.layers.BatchNormalization, keras.layers.Conv2D),
          ):
              assert layer.name in layer_names
  
imports: import typing
  import cv2
  import numpy
  import tensorflow
  import efficientnet.tfkeras
  from tensorflow import keras
  from .None import tools
label_desc: Use image node_id 12 for calling a global function with example usage: load_torch_weights(model, weights_path) without return types