code: def load_weights(self, weights_path):
      print("Loading weights")
      single_layers_weights, single_layers_biases = [], []
      for f in sorted(os.listdir(weights_path)):
          if f.startswith("single_mention_weights"):
              single_layers_weights.append(
                  np.load(os.path.join(weights_path, f))
              )
          if f.startswith("single_mention_bias"):
              single_layers_biases.append(
                  np.load(os.path.join(weights_path, f))
              )
      top_single_linear = (
          layer
          for layer in self.single_top
          if isinstance(layer, nn.Linear)
      )
      for w, b, layer in zip(
          single_layers_weights, single_layers_biases, top_single_linear
      ):
          layer.weight = nn.Parameter(torch.from_numpy(w).float())
          layer.bias = nn.Parameter(
              torch.from_numpy(b).float().squeeze()
          )
      pair_layers_weights, pair_layers_biases = [], []
      for f in sorted(os.listdir(weights_path)):
          if f.startswith("pair_mentions_weights"):
              pair_layers_weights.append(
                  np.load(os.path.join(weights_path, f))
              )
          if f.startswith("pair_mentions_bias"):
              pair_layers_biases.append(
                  np.load(os.path.join(weights_path, f))
              )
      top_pair_linear = (
          layer
          for layer in self.pair_top
          if isinstance(layer, nn.Linear)
      )
      for w, b, layer in zip(
          pair_layers_weights, pair_layers_biases, top_pair_linear
      ):
          layer.weight = nn.Parameter(torch.from_numpy(w).float())
          layer.bias = nn.Parameter(
              torch.from_numpy(b).float().squeeze()
          )
  
file_path: neuralcoref/neuralcoref/train/model.py
imports: import os
  import numpy
  import torch
  import torch.nn
  import torch.utils.data
label_desc: Use image node_id 4 for calling the Model obj's underlying member method code with example usage: obj.load_weights(weights_path) without return types