class_docstr: Encoder Decoder segmentors.
  
  EncoderDecoder typically consists of backbone, decode_head, auxiliary_head.
  Note that auxiliary_head is only used for deep supervision during training,
  which could be dumped during inference.
class_docstr_tok: ["Encoder","Decoder","segmentors",".","EncoderDecoder","typically","consists","of","backbone",",","decode_head",",","auxiliary_head",".","Note","that","auxiliary_head","is","only","used","for","deep","supervision","during","training",",","which","could","be","dumped","during","inference","."]
docstr: Inference with slide/whole style.
  
  Args:
      img (Tensor): The input image of shape (N, 3, H, W).
      img_meta (dict): Image info dict where each dict has: 'img_shape',
          'scale_factor', 'flip', and may also contain
          'filename', 'ori_shape', 'pad_shape', and 'img_norm_cfg'.
          For details on the values of these keys see
          `mmseg/datasets/pipelines/formatting.py:Collect`.
      rescale (bool): Whether rescale back to original shape.
  
  Returns:
      Tensor: The output segmentation map.
docstr_tok: ["Inference","with","slide\/whole","style",".","Args",":","img","(","Tensor",")",":","The","input","image","of","shape","(","N",",","3",",","H",",","W",")",".","img_meta","(","dict",")",":","Image","info","dict","where","each","dict","has",":","'img_shape","'",",","'scale_factor","'",",","'flip","'",",","and","may","also","contain","'filename","'",",","'ori_shape","'",",","'pad_shape","'",",","and","'img_norm_cfg","'",".","For","details","on","the","values","of","these","keys","see","`","mmseg\/datasets\/pipelines\/formatting.py",":","Collect","`",".","rescale","(","bool",")",":","Whether","rescale","back","to","original","shape",".","Returns",":","Tensor",":","The","output","segmentation","map","."]
code: def inference(self, img, img_meta, rescale):
      """Inference with slide/whole style.
  
      Args:
          img (Tensor): The input image of shape (N, 3, H, W).
          img_meta (dict): Image info dict where each dict has: 'img_shape',
              'scale_factor', 'flip', and may also contain
              'filename', 'ori_shape', 'pad_shape', and 'img_norm_cfg'.
              For details on the values of these keys see
              `mmseg/datasets/pipelines/formatting.py:Collect`.
          rescale (bool): Whether rescale back to original shape.
  
      Returns:
          Tensor: The output segmentation map.
      """
  
      assert self.test_cfg.mode in ["slide", "whole"]
      ori_shape = img_meta[0]["ori_shape"]
      assert all(_["ori_shape"] == ori_shape for _ in img_meta)
      if self.test_cfg.mode == "slide":
          seg_logit = self.slide_inference(img, img_meta, rescale)
      else:
          seg_logit = self.whole_inference(img, img_meta, rescale)
      output = F.softmax(seg_logit, dim=1)
      flip = img_meta[0]["flip"]
      if flip:
          flip_direction = img_meta[0]["flip_direction"]
          assert flip_direction in ["horizontal", "vertical"]
          if flip_direction == "horizontal":
              output = output.flip(dims=(3,))
          elif flip_direction == "vertical":
              output = output.flip(dims=(2,))
  
      return output
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from annotator.uniformer.mmseg.core import add_prefix
  from annotator.uniformer.mmseg.ops import resize
  from ..None import builder
  from ..builder import SEGMENTORS
  from .base import BaseSegmentor
label_desc: Use image node_id 14 for calling the EncoderDecoder obj's underlying member method code with example usage: obj.inference(img, img_meta, rescale) and returns: output