docstr: Get self.topk_labels_per_source_token top predicted words for vocab
  reduction (per source token).
docstr_tok: ["Get","self.topk_labels_per_source_token","top","predicted","words","for","vocab","reduction","(","per","source","token",")","."]
code: def get_topk_predicted_tokens(
      self, net_output, src_tokens, log_probs: bool
  ):
      """
      Get self.topk_labels_per_source_token top predicted words for vocab
      reduction (per source token).
      """
      assert (
          isinstance(self.topk_labels_per_source_token, int)
          and self.topk_labels_per_source_token > 0
      ), "topk_labels_per_source_token must be a positive int, or None"
  
      # number of labels to predict for each example in batch
      k = src_tokens.size(1) * self.topk_labels_per_source_token
      # [batch_size, vocab_size]
      probs = self.get_normalized_probs(net_output, log_probs)
      _, topk_indices = torch.topk(probs, k, dim=1)
  
      return topk_indices
  
file_path: translate/pytorch_translate/word_prediction/word_predictor.py
imports: import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 6 for calling the WordPredictor obj's underlying member method code with example usage: obj.get_topk_predicted_tokens(net_output, src_tokens, log_probs) and returns: topk_indices