code: def add_residual(self, x, residual, i, mask_info):
      if (
          residual is None
          or not self.decoder_cfg.decoder_residual
          or residual.size(1) != x.size(1)
      ):
          return x
  
      ret = x + residual
  
      return ret
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  import numpy
  from dataclasses import dataclass
  from fairseq.modules import LayerNorm, SamePad, SamePad2d, TransposeLast
label_desc: Use image node_id 3 for calling the DecoderBase obj's underlying member method code with example usage: obj.add_residual(x, residual, i, mask_info) and returns: ret, x