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: Initialize the weights in backbone and heads.
  
  Args:
      pretrained (str, optional): Path to pre-trained weights.
          Defaults to None.
docstr_tok: ["Initialize","the","weights","in","backbone","and","heads",".","Args",":","pretrained","(","str",",","optional",")",":","Path","to","pre-trained","weights",".","Defaults","to","None","."]
code: def init_weights(self, pretrained=None):
      """Initialize the weights in backbone and heads.
  
      Args:
          pretrained (str, optional): Path to pre-trained weights.
              Defaults to None.
      """
  
      super(EncoderDecoder, self).init_weights(pretrained)
      self.backbone.init_weights(pretrained=pretrained)
      self.decode_head.init_weights()
      if self.with_auxiliary_head:
          if isinstance(self.auxiliary_head, nn.ModuleList):
              for aux_head in self.auxiliary_head:
                  aux_head.init_weights()
          else:
              self.auxiliary_head.init_weights()
  
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 4 for calling the EncoderDecoder obj's underlying member method code with example usage: obj.init_weights(pretrained) without return types