class_docstr: This class implements `FastViT architecture <https://arxiv.org/pdf/2303.14189.pdf>`_
class_docstr_tok: ["This","class","implements","`","FastViT","architecture","<","https",":","\/\/arxiv.org\/pdf\/2303.14189.pdf",">","`","_"]
docstr: Init. for mmdetection or mmsegmentation by loading
  ImageNet pre-trained weights.
code: def init_weights(self, pretrained: str = None) -> None:
      """Init. for mmdetection or mmsegmentation by loading
      ImageNet pre-trained weights.
      """
      logger = get_root_logger()
      if self.init_cfg is None and pretrained is None:
          logger.warning(
              f"No pre-trained weights for "
              f"{self.__class__.__name__}, "
              f"training start from scratch"
          )
          pass
      else:
          assert "checkpoint" in self.init_cfg, (
              f"Only support "
              f"specify `Pretrained` in "
              f"`init_cfg` in "
              f"{self.__class__.__name__} "
          )
          if self.init_cfg is not None:
              ckpt_path = self.init_cfg["checkpoint"]
          elif pretrained is not None:
              ckpt_path = pretrained
  
          ckpt = _load_checkpoint(
              ckpt_path, logger=logger, map_location="cpu"
          )
          if "state_dict" in ckpt:
              _state_dict = ckpt["state_dict"]
          elif "model" in ckpt:
              _state_dict = ckpt["model"]
          else:
              _state_dict = ckpt
  
          sterile_dict = FastViT._scrub_checkpoint(_state_dict, self)
          state_dict = sterile_dict
          missing_keys, unexpected_keys = self.load_state_dict(
              state_dict, False
          )
  
imports: import os
  import copy
  from functools import partial
  from typing import List, Tuple, Optional, Union
  import torch
  import torch.nn
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
  from timm.models.layers import DropPath, trunc_normal_
  from timm.models.registry import register_model
  from models.modules.mobileone import MobileOneBlock
  from models.modules.replknet import ReparamLargeKernelConv
label_desc: Use image node_id 4 for calling the FastViT obj's underlying member method code with example usage: obj.init_weights(pretrained) without return types