tfm.nlp.models.T5Transformer

Transformer Encoder+Decoder for sequence to sequence.

dtype the variable allocation dtype.
name a string for the module name.

checkpoint_items

Methods

create_variable

View source

decode

View source

encode

View source

read_variable

View source

__call__

View source

Applies Transformer model on the inputs.

Args
encoder_input_tokens input tokens to the encoder.
decoder_target_tokens target tokens to the decoder.
encoder_dense_inputs input dense vectors to the encoder.
encoder_dense_segment_ids dense input segmentation info for packed
decoder_input_tokens input tokens to the decoder, only required for training.
encoder_segment_ids input segmentation info for packed examples. examples.
decoder_segment_ids target segmentation info for packed examples.
training whether it is training pass, affecting dropouts.

Returns
a dictionary of logits/cache.