class_docstr: Base class for different image classification models
class_docstr_tok: ["Base","class","for","different","image","classification","models"]
docstr: Extract feature maps from different spatial levels of the model.
  
  Args:
      x: Input image tensor
      use_l5: Include features from `layer_5` in the output dictionary. Defaults to True.
      use_l5_exp: Include features from `conv_1x1_exp` in the output dictionary. Defaults to False.
  
  Returns:
      A mapping containing the name and output at each spatial-level of the model.
  
  ...note:
      This is useful for down-stream tasks.
docstr_tok: ["Extract","feature","maps","from","different","spatial","levels","of","the","model",".","Args",":","x",":","Input","image","tensor","use_l5",":","Include","features","from","`","layer_5","`","in","the","output","dictionary",".","Defaults","to","True",".","use_l5_exp",":","Include","features","from","`","conv_1x1_exp","`","in","the","output","dictionary",".","Defaults","to","False",".","Returns",":","A","mapping","containing","the","name","and","output","at","each","spatial-level","of","the","model",".","...","note",":","This","is","useful","for","down-stream","tasks","."]
code: def extract_end_points_all(
      self,
      x: Tensor,
      use_l5: Optional[bool] = True,
      use_l5_exp: Optional[bool] = False,
      *args,
      **kwargs,
  ) -> Dict[str, Tensor]:
      """Extract feature maps from different spatial levels of the model.
  
      Args:
          x: Input image tensor
          use_l5: Include features from `layer_5` in the output dictionary. Defaults to True.
          use_l5_exp: Include features from `conv_1x1_exp` in the output dictionary. Defaults to False.
  
      Returns:
          A mapping containing the name and output at each spatial-level of the model.
  
      ...note:
          This is useful for down-stream tasks.
      """
      out_dict = (
          {}
      )  # Use dictionary over NamedTuple so that JIT is happy
  
      if self.training and self.neural_augmentor is not None:
          x = self.neural_augmentor(x)
          out_dict["augmented_tensor"] = x
  
      x = self._forward_layer(self.conv_1, x)  # 112 x112
      x = self._forward_layer(self.layer_1, x)  # 112 x112
      out_dict["out_l1"] = x
  
      x = self._forward_layer(self.layer_2, x)  # 56 x 56
      out_dict["out_l2"] = x
  
      x = self._forward_layer(self.layer_3, x)  # 28 x 28
      out_dict["out_l3"] = x
  
      x = self._forward_layer(self.layer_4, x)  # 14 x 14
      out_dict["out_l4"] = x
  
      if use_l5:
          x = self._forward_layer(self.layer_5, x)  # 7 x 7
          out_dict["out_l5"] = x
  
          if use_l5_exp:
              x = self._forward_layer(self.conv_1x1_exp, x)
              out_dict["out_l5_exp"] = x
      return out_dict
  
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 6 for calling the BaseImageEncoder obj's underlying member method code with example usage: obj.extract_end_points_all(x, use_l5, use_l5_exp) and returns: out_dict