class_docstr: Implementation of an AnyNet.
  
  See https://arxiv.org/abs/2003.13678 for details.
class_docstr_tok: ["Implementation","of","an","AnyNet",".","See","https",":","\/\/arxiv.org\/abs\/2003.13678","for","details","."]
code: def init_weights(self):
      # Performs ResNet-style weight initialization
      for m in self.modules():
          if isinstance(m, nn.Conv2d):
              # Note that there is no bias due to BN
              fan_out = (
                  m.kernel_size[0] * m.kernel_size[1] * m.out_channels
              )
              m.weight.data.normal_(
                  mean=0.0, std=math.sqrt(2.0 / fan_out)
              )
          elif isinstance(m, nn.BatchNorm2d):
              m.weight.data.fill_(1.0)
              m.bias.data.zero_()
          elif isinstance(m, nn.Linear):
              m.weight.data.normal_(mean=0.0, std=0.01)
              m.bias.data.zero_()
  
imports: import math
  from collections import OrderedDict
  from enum import auto, Enum
  from typing import Any, Dict, Optional, Sequence
  import torch.nn
  from classy_vision.generic.util import get_torch_version
  from classy_vision.models import ClassyModel, register_model
  from classy_vision.models.squeeze_and_excitation_layer import SqueezeAndExcitationLayer
label_desc: Use image node_id 4 for calling the AnyNet obj's underlying member method code with example usage: obj.init_weights() without return types