class_docstr: An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained
  models.
class_docstr_tok: ["An","abstract","class","to","handle","weights","initialization","and","a","simple","interface","for","downloading","and","loading","pretrained","models","."]
code: def _init_weights(self, module):
      if isinstance(module, nn.Conv2d):
          nn.init.kaiming_normal_(
              module.weight, mode="fan_out", nonlinearity="relu"
          )
      elif isinstance(module, (nn.BatchNorm2d, nn.GroupNorm)):
          nn.init.constant_(module.weight, 1)
          nn.init.constant_(module.bias, 0)
  
imports: from typing import Optional
  import torch
  import torch.utils.checkpoint
  from torch import Tensor, nn
  from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
  from ...activations import ACT2FN
  from ...file_utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward
  from ...modeling_outputs import BaseModelOutputWithNoAttention, BaseModelOutputWithPoolingAndNoAttention, ImageClassifierOutputWithNoAttention
  from ...modeling_utils import PreTrainedModel
  from ...utils import logging
  from .configuration_regnet import RegNetConfig
label_desc: Use image node_id 1 for calling the RegNetPreTrainedModel obj's underlying member method code with example usage: obj._init_weights(module) without return types