class_docstr: DocModel that includes a user embedding which learns user features to produce
  personalized prediction. In this class, user-embedding is fed directly to
  the decoder (i.e., does not go through the encoders).
class_docstr_tok: ["DocModel","that","includes","a","user","embedding","which","learns","user","features","to","produce","personalized","prediction",".","In","this","class",",","user-embedding","is","fed","directly","to","the","decoder","(","i.e.",",","does","not","go","through","the","encoders",")","."]
code: def forward(self, *inputs) -> List[torch.Tensor]:
      # Override forward() to include user_embedding layer explictily to the
      # computation of the forward propagation.
      embedding_input = inputs[: self.embedding.num_emb_modules]
      token_emb = self.embedding(*embedding_input)
  
      inputs, user_ids = inputs[:-1], inputs[-1]
      other_input = inputs[
          self.embedding.num_emb_modules : len(inputs)
          - self.decoder.num_decoder_modules
      ]
      input_representation = self.representation(
          token_emb, *other_input
      )
  
      # Some LSTM-based representations return states as (h0, c0).
      if isinstance(input_representation[-1], tuple):
          input_representation = input_representation[0]
  
      user_embeddings = self.user_embedding(user_ids)
      # Reduce dim from (batch_size, 1, emb_dim) to (batch_size, emb_dim).
      if user_embeddings.dim() == 3:
          user_embeddings = user_embeddings.squeeze(dim=1)
  
      decoder_inputs: tuple = ()
      if self.decoder.num_decoder_modules:
          decoder_inputs = inputs[-(self.decoder.num_decoder_modules) :]
  
      return self.decoder(
          input_representation, user_embeddings, *decoder_inputs
      )
  
imports: from typing import Dict, List, Optional, Union
  import torch
  from pytext.config.component import create_loss
  from pytext.data.tensorizers import ByteTokenTensorizer, FloatListTensorizer, LabelTensorizer, NumericLabelTensorizer, Tensorizer, TokenTensorizer, UidTensorizer, VocabConfig
  from pytext.data.tokenizers import DoNothingTokenizer
  from pytext.exporters.exporter import ModelExporter
  from pytext.loss import BinaryCrossEntropyLoss, BinaryCrossEntropyWithLogitsLoss, MultiLabelSoftMarginLoss
  from pytext.models.decoders.mlp_decoder import DecoderBase, MLPDecoder
  from pytext.models.embeddings import CharacterEmbedding, EmbeddingBase, EmbeddingList, WordEmbedding
  from pytext.models.model import Model
  from pytext.models.module import create_module
  from pytext.models.output_layers import ClassificationOutputLayer, OutputLayerBase, RegressionOutputLayer
  from pytext.models.output_layers.doc_classification_output_layer import BinaryClassificationOutputLayer, MulticlassOutputLayer, MultiLabelOutputLayer
  from pytext.models.representations.bilstm_doc_attention import BiLSTMDocAttention
  from pytext.models.representations.deepcnn import DeepCNNRepresentation
  from pytext.models.representations.docnn import DocNNRepresentation
  from pytext.models.representations.pure_doc_attention import PureDocAttention
  from pytext.models.representations.representation_base import RepresentationBase
  from pytext.torchscript.utils import make_byte_inputs, make_sequence_lengths, truncate_tokens
  from pytext.torchscript.vocab import ScriptVocabulary
  from pytext.utils.label import get_label_weights
  from pytext.utils.usage import log_class_usage
  from pytorch.text.fb.utils.transform_utils import pad_2d
  from torch import jit
label_desc: Use image node_id 7 for calling the PersonalizedDocModel obj's underlying member method code with example usage: obj.forward() and returns: self