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",">","`","_"]
code: def forward(self, x: torch.Tensor) -> torch.Tensor:
      # input embedding
      x = self.forward_embeddings(x)
      # through backbone
      x = self.forward_tokens(x)
      if self.fork_feat:
          # output features of four stages for dense prediction
          return x
      # for image classification
      x = self.conv_exp(x)
      x = self.gap(x)
      x = x.view(x.size(0), -1)
      cls_out = self.head(x)
      return cls_out
  
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 7 for calling the FastViT obj's underlying member method code with example usage: obj.forward(x) and returns: cls_out, x