code: def spectral_norm(module, init=True, std=1, bound=False):
      if init:
          nn.init.normal_(module.weight, 0, std)
  
      if hasattr(module, "bias") and module.bias is not None:
          module.bias.data.zero_()
  
      SpectralNorm.apply(module, "weight", bound=bound)
  
      return module
  
file_path: DIG/dig/ggraph/method/GraphEBM/energy_func.py
imports: import torch
  from torch import nn
  from torch.nn import functional
label_desc: Use image node_id 2 for calling a global function with example usage: spectral_norm(module, init, std, bound) and returns: module