code: def init_weights(layer):
      """
      Init the weights of transformer.
      Args:
          layer(nn.Layer): The layer to init weights.
      Returns:
          None
      """
      if isinstance(layer, nn.Linear):
          trunc_normal_(layer.weight)
          if layer.bias is not None:
              zeros_(layer.bias)
      elif isinstance(layer, nn.LayerNorm):
          zeros_(layer.bias)
          ones_(layer.weight)
  
file_path: PaddleSeg/paddleseg/models/backbones/transformer_utils.py
imports: import paddle
  import paddle.nn
  import paddle.nn.initializer
label_desc: Use image node_id 3 for calling a global function with example usage: init_weights(layer) without return types