code: def initialize_weights(method="kaiming", *models):
      for model in models:
          for module in model.modules():
              if isinstance(
                  module, (nn.Conv2d, nn.ConvTranspose2d, nn.Linear)
              ):
                  if method == "kaiming":
                      init.kaiming_normal_(
                          module.weight.data, np.sqrt(2.0)
                      )
                  elif method == "xavier":
                      init.xavier_normal(
                          module.weight.data, np.sqrt(2.0)
                      )
                  elif method == "orthogonal":
                      init.orthogonal(module.weight.data, np.sqrt(2.0))
                  elif method == "normal":
                      init.normal(module.weight.data, mean=0, std=0.02)
                  if module.bias is not None:
                      init.constant(module.bias.data, 0)
  
file_path: pywick/pywick/models/segmentation/resnet_gcn.py
imports: import torch.nn
  import torch.nn.init
  import torch.nn.functional
  import torchvision.models
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: initialize_weights(method) without return types