class_docstr: Convolutional decoder
class_docstr_tok: ["Convolutional","decoder"]
code: def forward(self, prev_output_tokens, encoder_out):
      trained_encoder_out = (
          encoder_out["pretrained"] if self.pretrained else None
      )
      encoder_out = encoder_out["encoder"]["encoder_out"]
  
      encoder_a, encoder_b = self._split_encoder_out(encoder_out)
  
      # embed positions
      positions = self.embed_positions(prev_output_tokens)
  
      # embed tokens and positions
      x = self.embed_tokens(prev_output_tokens) + positions
      x = self.dropout_module(x)
      target_embedding = x.transpose(0, 1)
  
      # project to size of convolution
      x = self.fc1(x)
  
      # B x T x C -> T x B x C
      x = x.transpose(0, 1)
  
      # temporal convolutions
      avg_attn_scores = None
      for proj, conv, attention, selfattention, attproj in zip(
          self.projections,
          self.convolutions,
          self.attention,
          self.selfattention,
          self.attproj,
      ):
          residual = x if proj is None else proj(x)
  
          x = self.dropout_module(x)
          x = conv(x)
          x = F.glu(x, dim=2)
  
          # attention
          if attention is not None:
              r = x
              x, attn_scores = attention(
                  attproj(x) + target_embedding, encoder_a, encoder_b
              )
              x = x + r
              if not self.training and self.need_attn:
                  if avg_attn_scores is None:
                      avg_attn_scores = attn_scores
                  else:
                      avg_attn_scores.add_(attn_scores)
  
          if selfattention is not None:
              x = selfattention(x)
  
          x = (x + residual) * math.sqrt(0.5)
  
      # T x B x C -> B x T x C
      x = x.transpose(0, 1)
  
      # project back to size of vocabulary
      x = self.fc2(x)
      x = self.dropout_module(x)
      if not self.pretrained:
          x = self.fc3(x)
  
      # fusion gating
      if self.pretrained:
          trained_x, _ = self.pretrained_decoder.forward(
              prev_output_tokens, trained_encoder_out
          )
          y = torch.cat([x, self.pretrained_outputs["out"]], dim=-1)
          gate1 = self.gate1(y)
          gate2 = self.gate2(y)
          gated_x1 = gate1 * x
          gated_x2 = gate2 * self.pretrained_outputs["out"]
          fusion = torch.cat([gated_x1, gated_x2], dim=-1)
          fusion = self.joining(fusion)
          fusion_output = self.fc3(fusion)
          return fusion_output, avg_attn_scores
      else:
          return x, avg_attn_scores
  
imports: import logging
  import math
  import os
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import checkpoint_utils
  from fairseq.incremental_decoding_utils import with_incremental_state
  from fairseq.models import CompositeEncoder, FairseqDecoder, FairseqEncoder, FairseqEncoderDecoderModel, register_model, register_model_architecture
  from fairseq.modules import DownsampledMultiHeadAttention, FairseqDropout, GradMultiply, LayerNorm, LearnedPositionalEmbedding, LinearizedConvolution
label_desc: Use image node_id 2 for calling the FConvDecoder obj's underlying member method code with example usage: obj.forward(prev_output_tokens, encoder_out) and returns: fusion_output,  avg_attn_scores, x,  avg_attn_scores