code: def weights_init(m):
      """
      Code from https://gist.github.com/jeasinema/ed9236ce743c8efaf30fa2ff732749f5
      Usage:
          model = Model()
          model.apply(weight_init)
      """
      if isinstance(m, nn.Linear):
          init.xavier_normal_(m.weight.data)
          init.normal_(m.bias.data)
      elif isinstance(m, nn.GRUCell):
          for param in m.parameters():
              if len(param.shape) >= 2:
                  init.orthogonal_(param.data)
              else:
                  init.normal_(param.data)
  
file_path: dgl/examples/pytorch/dgmg/utils.py
imports: import datetime
  import os
  import random
  from pprint import pprint
  import matplotlib.pyplot
  import torch
  import torch.backends.cudnn
  import torch.nn
  import torch.nn.init
label_desc: Use image node_id 6 for calling a global function with example usage: weights_init(m) without return types