code: def spectral_norm(
      module, name="weight", n_power_iterations=1, eps=1e-12, dim=None
  ):
      if dim is None:
          if isinstance(
              module,
              (
                  nn.Conv1DTranspose,
                  nn.Conv2DTranspose,
                  nn.Conv3DTranspose,
                  nn.Linear,
              ),
          ):
              dim = 1
          else:
              dim = 0
      SpectralNorm.apply(module, name, n_power_iterations, dim, eps)
      return module
  
file_path: PaddleOCR/StyleText/arch/spectral_norm.py
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
label_desc: Use image node_id 2 for calling a global function with example usage: spectral_norm(module, name, n_power_iterations, eps, dim) and returns: module