class_docstr: MobileNetV3 Feature Extractor
  
  A work-in-progress feature extraction module for MobileNet-V3 to use as a backbone for segmentation
  and object detection models.
class_docstr_tok: ["MobileNetV3","Feature","Extractor","A","work-in-progress","feature","extraction","module","for","MobileNet-V3","to","use","as","a","backbone","for","segmentation","and","object","detection","models","."]
code: def forward(self, x: torch.Tensor) -> List[torch.Tensor]:
      x = self.conv_stem(x)
      x = self.bn1(x)
      x = self.act1(x)
      if self.feature_hooks is None:
          features = []
          if 0 in self._stage_out_idx:
              features.append(x)  # add stem out
          for i, b in enumerate(self.blocks):
              if (
                  self.grad_checkpointing
                  and not torch.jit.is_scripting()
              ):
                  x = checkpoint(b, x)
              else:
                  x = b(x)
              if i + 1 in self._stage_out_idx:
                  features.append(x)
          return features
      else:
          self.blocks(x)
          out = self.feature_hooks.get_output(x.device)
          return list(out.values())
  
imports: from functools import partial
  from typing import Callable, List, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.utils.checkpoint import checkpoint
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, IMAGENET_INCEPTION_MEAN, IMAGENET_INCEPTION_STD
  from timm.layers import SelectAdaptivePool2d, Linear, LayerType, PadType, create_conv2d, get_norm_act_layer
  from ._builder import build_model_with_cfg, pretrained_cfg_for_features
  from ._efficientnet_blocks import SqueezeExcite
  from ._efficientnet_builder import BlockArgs, EfficientNetBuilder, decode_arch_def, efficientnet_init_weights, round_channels, resolve_bn_args, resolve_act_layer, BN_EPS_TF_DEFAULT
  from ._features import FeatureInfo, FeatureHooks
  from ._manipulate import checkpoint_seq
  from ._registry import generate_default_cfgs, register_model, register_model_deprecations
label_desc: Use image node_id 3 for calling the MobileNetV3Features obj's underlying member method code with example usage: obj.forward(x) and returns: features, list