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`, with an exception that
  it only returns output in a dictionary form till `layer_4` of the model.
docstr_tok: ["This","function","is","similar","to","`","extract_end_points_all","`",",","with","an","exception","that","it","only","returns","output","in","a","dictionary","form","till","`","layer_4","`","of","the","model","."]
code: def extract_end_points_l4(
      self, x: Tensor, *args, **kwargs
  ) -> Dict[str, Tensor]:
      """This function is similar to `extract_end_points_all`, with an exception that
      it only returns output in a dictionary form till `layer_4` of the model.
      """
      return self.extract_end_points_all(x, use_l5=False)
  
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 7 for calling the BaseImageEncoder obj's underlying member method code with example usage: obj.extract_end_points_l4(x) and returns: self