class_docstr: Base class for different image classification models
class_docstr_tok: ["Base","class","for","different","image","classification","models"]
docstr: This function is similar to `extract_end_points_all`. However, it returns a single tensor as the
  output of the last layer instead of a dictionary, and is typically used during classification tasks where
  intermediate feature maps are not required.
docstr_tok: ["This","function","is","similar","to","`","extract_end_points_all","`",".","However",",","it","returns","a","single","tensor","as","the","output","of","the","last","layer","instead","of","a","dictionary",",","and","is","typically","used","during","classification","tasks","where","intermediate","feature","maps","are","not","required","."]
code: def extract_features(self, x: Tensor, *args, **kwargs) -> Tensor:
      """This function is similar to `extract_end_points_all`. However, it returns a single tensor as the
      output of the last layer instead of a dictionary, and is typically used during classification tasks where
      intermediate feature maps are not required.
      """
      x = self._forward_layer(self.conv_1, x)
      x = self._forward_layer(self.layer_1, x)
      x = self._forward_layer(self.layer_2, x)
      x = self._forward_layer(self.layer_3, x)
  
      x = self._forward_layer(self.layer_4, x)
      x = self._forward_layer(self.layer_5, x)
      x = self._forward_layer(self.conv_1x1_exp, x)
      return x
  
imports: import argparse
  from typing import Any, Dict, List, Mapping, Optional, Tuple
  import torch
  from torch import Tensor, nn
  from torch.utils.checkpoint import checkpoint
  from common import is_test_env
  from cvnets.layers import LinearLayer
  from cvnets.misc.init_utils import initialize_fc_layer
  from cvnets.models import MODEL_REGISTRY, BaseAnyNNModel
  from cvnets.neural_augmentor import build_neural_augmentor
  from utils import logger
label_desc: Use image node_id 8 for calling the BaseImageEncoder obj's underlying member method code with example usage: obj.extract_features(x) and returns: x