class_docstr: A subclass which adds words prediction to RNN arch.
class_docstr_tok: ["A","subclass","which","adds","words","prediction","to","RNN","arch","."]
code: def get_targets(self, sample, net_output):
      targets = sample["target"].view(-1)
      possible_translation_tokens = net_output[-1]
      if possible_translation_tokens is not None:
          targets = torch_find(
              possible_translation_tokens,
              targets,
              len(self.task.target_dictionary),
          )
      return targets
  
file_path: translate/pytorch_translate/word_prediction/word_prediction_model.py
imports: from fairseq.models import FairseqEncoderDecoderModel, register_model, register_model_architecture
  from pytorch_translate import rnn
  from pytorch_translate.rnn import LSTMSequenceEncoder, RNNDecoder, RNNEncoder, RNNModel
  from pytorch_translate.utils import torch_find
  from pytorch_translate.word_prediction import word_predictor
label_desc: Use image node_id 3 for calling the RNNWordPredictionModel obj's underlying member method code with example usage: obj.get_targets(sample, net_output) and returns: targets