class_docstr: Cascade Encoder Decoder segmentors.
  
  CascadeEncoderDecoder almost the same as EncoderDecoder, while decoders of
  CascadeEncoderDecoder are cascaded. The output of previous decoder_head
  will be the input of next decoder_head.
class_docstr_tok: ["Cascade","Encoder","Decoder","segmentors",".","CascadeEncoderDecoder","almost","the","same","as","EncoderDecoder",",","while","decoders","of","CascadeEncoderDecoder","are","cascaded",".","The","output","of","previous","decoder_head","will","be","the","input","of","next","decoder_head","."]
docstr: Initialize ``decode_head``
docstr_tok: ["Initialize","``","decode_head","``"]
code: def _init_decode_head(self, decode_head):
      """Initialize ``decode_head``"""
      assert isinstance(decode_head, list)
      assert len(decode_head) == self.num_stages
      self.decode_head = nn.ModuleList()
      for i in range(self.num_stages):
          self.decode_head.append(builder.build_head(decode_head[i]))
      self.align_corners = self.decode_head[-1].align_corners
      self.num_classes = self.decode_head[-1].num_classes
  
file_path: lavis/lavis/common/annotator/uniformer/mmseg/models/segmentors/cascade_encoder_decoder.py
imports: from torch import nn
  from annotator.uniformer.mmseg.core import add_prefix
  from annotator.uniformer.mmseg.ops import resize
  from ..None import builder
  from ..builder import SEGMENTORS
  from .encoder_decoder import EncoderDecoder
label_desc: Use image node_id 2 for calling the CascadeEncoderDecoder obj's underlying member method code with example usage: obj._init_decode_head(decode_head) without return types