class_docstr: HorNet
  
  Args:
      in_chans (`int`): Number of input channels.
      num_classes (`int`): Number for classes for classification.
      depths (`tuple`): Model depths.
      base_dim (`int`): Base dimensions.
      drop_path_rate (`float`): Drop ratio of drop path.
      layer_scale_init_value (`float`): Initial value to scale layer.
      head_init_scale (`float`): Initial value to scale head.
      gnconv (`nn.Module`): gnConv layer(s).
      uniform_init (`bool`): Flag to control whether to apply the uniform initial weights.
class_docstr_tok: ["HorNet","Args",":","in_chans","(","`","int","`",")",":","Number","of","input","channels",".","num_classes","(","`","int","`",")",":","Number","for","classes","for","classification",".","depths","(","`","tuple","`",")",":","Model","depths",".","base_dim","(","`","int","`",")",":","Base","dimensions",".","drop_path_rate","(","`","float","`",")",":","Drop","ratio","of","drop","path",".","layer_scale_init_value","(","`","float","`",")",":","Initial","value","to","scale","layer",".","head_init_scale","(","`","float","`",")",":","Initial","value","to","scale","head",".","gnconv","(","`","nn.Module","`",")",":","gnConv","layer","(","s",")",".","uniform_init","(","`","bool","`",")",":","Flag","to","control","whether","to","apply","the","uniform","initial","weights","."]
code: def _init_weights(self, m):
      if not self.uniform_init:
          if isinstance(m, (nn.Conv2d, nn.Linear)):
              trunc_normal_(m.weight, std=0.02)
              if hasattr(m, "bias") and m.bias is not None:
                  nn.init.constant_(m.bias, 0)
      else:
          if isinstance(m, (nn.Conv2d, nn.Linear)):
              nn.init.xavier_uniform_(m.weight)
              if hasattr(m, "bias") and m.bias is not None:
                  nn.init.constant_(m.bias, 0)
  
file_path: towhee/towhee/models/hornet/hornet.py
imports: import torch
  from torch import nn
  from towhee.models.utils.weight_init import trunc_normal_
  from towhee.models.utils import create_model
  from towhee.models.convnext.utils import LayerNorm
  from towhee.models.hornet import Block, GatedConv, get_configs
label_desc: Use image node_id 2 for calling the HorNet obj's underlying member method code with example usage: obj._init_weights(m) without return types