class_docstr: Fake wrapper for RegNet that mimics what vissl does without the need to pass a config file.
class_docstr_tok: ["Fake","wrapper","for","RegNet","that","mimics","what","vissl","does","without","the","need","to","pass","a","config","file","."]
code: def __init__(self, model: nn.Module):
      super().__init__()
  
      feature_blocks: List[Tuple[str, nn.Module]] = []
      # - get the stem
      feature_blocks.append(("conv1", model.stem))
      # - get all the feature blocks
      for k, v in model.trunk_output.named_children():
          assert k.startswith("block"), f"Unexpected layer name {k}"
          block_index = len(feature_blocks) + 1
          feature_blocks.append((f"res{block_index}", v))
  
      self._feature_blocks = nn.ModuleDict(feature_blocks)
  
imports: import argparse
  import json
  from dataclasses import dataclass, field
  from functools import partial
  from pathlib import Path
  from typing import Callable, Dict, List, Tuple
  import timm
  import torch
  import torch.nn
  from classy_vision.models.regnet import RegNet, RegNetParams, RegNetY32gf, RegNetY64gf, RegNetY128gf
  from huggingface_hub import cached_download, hf_hub_url
  from torch import Tensor
  from vissl.models.model_helpers import get_trunk_forward_outputs
  from transformers import AutoImageProcessor, RegNetConfig, RegNetForImageClassification, RegNetModel
  from transformers.utils import logging
label_desc: Use image node_id 1 to create a new FakeRegNetVisslWrapper object from inherited base classes: nn with example: obj = FakeRegNetVisslWrapper(model)