class_docstr: This class defines a encoder-decoder architecture for the task of semantic segmentation. Different segmentation
  heads (e.g., PSPNet and DeepLabv3) can be used
  
  Args:
      opts: command-line arguments
      encoder (BaseImageEncoder): Backbone network (e.g., MobileViT or ResNet)
class_docstr_tok: ["This","class","defines","a","encoder-decoder","architecture","for","the","task","of","semantic","segmentation",".","Different","segmentation","heads","(","e.g.",",","PSPNet","and","DeepLabv3",")","can","be","used","Args",":","opts",":","command-line","arguments","encoder","(","BaseImageEncoder",")",":","Backbone","network","(","e.g.",",","MobileViT","or","ResNet",")"]
code: def forward(
      self, x: Tensor, *args, **kwargs
  ) -> Union[Tuple[Tensor, Tensor], Tensor, Dict]:
      enc_end_points: Dict = self.encoder.extract_end_points_all(
          x, use_l5=True, use_l5_exp=self.use_l5_exp
      )
  
      if "augmented_tensor" in enc_end_points:
          output_dict = {
              "augmented_tensor": enc_end_points.pop(
                  "augmented_tensor"
              ),
              "segmentation_output": self.seg_head(
                  enc_out=enc_end_points, *args, **kwargs
              ),
          }
          return output_dict
      else:
          return self.seg_head(enc_out=enc_end_points, *args, **kwargs)
  
file_path: ml-cvnets/cvnets/models/segmentation/enc_dec.py
imports: import argparse
  from typing import Dict, Optional, Tuple, Union
  from torch import Tensor
  from cvnets.models import MODEL_REGISTRY, BaseAnyNNModel, get_model
  from cvnets.models.classification.base_image_encoder import BaseImageEncoder
  from cvnets.models.segmentation.base_seg import BaseSegmentation, set_model_specific_opts_before_model_building, unset_model_specific_opts_after_model_building
label_desc: Use image node_id 3 for calling the SegEncoderDecoder obj's underlying member method code with example usage: obj.forward(x) and returns: output_dict, self