class_docstr: Combines decoder_embedding with the decoder component
class_docstr_tok: ["Combines","decoder_embedding","with","the","decoder","component"]
code: def forward(
      self,
      input_ids,
      decoder_mask,
      encoder_mask,
      encoder_embeddings,
      decoder_mems,
  ):
      position_ids = build_position_ids(input_ids)
      dec_input = self.decoder_embedding(
          input_ids, position_ids, token_type_ids=None
      )
  
      rpe = None
      if self.rpe is not None:
          rpe = self.rpe(
              query_seq_length=input_ids.size(1),
              key_seq_length=input_ids.size(1),
          )
  
      dec_out = (
          self.decoder(
              dec_input,
              decoder_mask,
              encoder_embeddings.permute(1, 0, 2),
              encoder_mask,
              dec_self_attention_relative_position_bias=rpe,
          )
          .permute(1, 0, 2)
          .float()
      )
  
      zeros = torch.zeros(
          (
              decoder_mems.shape[0],
              self.decoder.num_layers,
              dec_out.shape[1],
              decoder_mems.shape[-1],
          )
      ).to(self.device)
  
      return torch.cat((zeros, dec_out.unsqueeze(1)), dim=1)
  
imports: import random
  from typing import Dict, List, Optional
  import torch
  import torch.nn.functional
  from nemo.collections.nlp.modules.common.megatron.utils import build_position_ids
  from nemo.core.classes.exportable import Exportable
  from nemo.core.neural_types import ChannelType, EncodedRepresentation, MaskType, NeuralType
label_desc: Use image node_id 4 for calling the DecEmb obj's underlying member method code with example usage: obj.forward(input_ids, decoder_mask, encoder_mask, encoder_embeddings, decoder_mems) and returns: torch