class_docstr: Common super class for decoder networks with output projection layers.
  
  This class couples common functionality for `FairseqDecoder`s with large
  output projection layers such as ONNX compatibility and vocabulary reduction.
class_docstr_tok: ["Common","super","class","for","decoder","networks","with","output","projection","layers",".","This","class","couples","common","functionality","for","`","FairseqDecoder","`","s","with","large","output","projection","layers","such","as","ONNX","compatibility","and","vocabulary","reduction","."]
code: def _precompute_reduced_weights(self, possible_translation_tokens):
      output_projection_w = self.output_projection_w.index_select(
          dim=0, index=possible_translation_tokens
      )
      output_projection_b = self.output_projection_b.index_select(
          dim=0, index=possible_translation_tokens
      )
      return (output_projection_w, output_projection_b)
  
imports: import abc
  import math
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import utils
  from fairseq.models import FairseqIncrementalDecoder, transformer
  from pytorch_translate import rnn_cell, utils, vocab_reduction
  from pytorch_translate.research.lexical_choice import lexical_translation
label_desc: Use image node_id 3 for calling the DecoderWithOutputProjection obj's underlying member method code with example usage: obj._precompute_reduced_weights(possible_translation_tokens) and returns: output_projection_w,  output_projection_b