code: def init_weights(module: nn.Module):
      """
      Initialize one module. It uses xavier_norm to initialize nn.Embedding
      and xavier_uniform to initialize nn.Linear's weight.
  
      Parameters
      ----------
      module
          A Pytorch nn.Module.
      """
      if isinstance(module, nn.Embedding):
          nn.init.xavier_normal_(module.weight)
      elif isinstance(module, nn.Linear):
          nn.init.xavier_uniform_(module.weight)
          if module.bias is not None:
              nn.init.zeros_(module.bias)
      elif isinstance(module, nn.LayerNorm):
          module.bias.data.zero_()
          module.weight.data.fill_(1.0)
  
imports: import logging
  import re
  import warnings
  from typing import Dict, List, Optional, Tuple
  import torch
  import torch._dynamo
  import torch.nn.functional
  from torch import nn
  from torch.nn.modules.loss import _Loss
  from transformers import AutoConfig, AutoModel, AutoTokenizer, BertTokenizer, CLIPTokenizer, ElectraTokenizer
  from transformers.models.mask2former.modeling_mask2former import Mask2FormerLoss
  from ..constants import AUTOMM, CLASS_LOGITS, COLUMN_FEATURES, FEATURES, LOGITS, MASKS, OCR, PEFT_ADDITIVE_STRATEGIES, REGRESSION, SEMANTIC_MASK, SEMANTIC_SEGMENTATION
  from .adaptation_layers import IA3Linear, IA3LoRALinear, LoRALinear
label_desc: Use image node_id 1 for calling a global function with example usage: init_weights(module) without return types