def get(decoder_type):
  """Returns a decoder instance of the specified type."""
  if decoder_type == U.DEC_BASIC:
    decoder = BasicRNNDecoder()
  elif decoder_type == U.DEC_ATTENTIVE:
    decoder = AttentiveRNNDecoder()
  else:
    raise ValueError("Unknown decoder type: %s. The type must be one of %s."
                     % (decoder_type, str(U.DEC_TYPES)))
  return decoder
Returns a decoder instance of the specified type.
language/labs/consistent_zero_shot_nmt/modules/decoders.py