hkproj/pytorch-transformer

forward method in transformer class

Closed this issue · 1 comments

Hi,
It seems there is something wrong with transformer class. It does not have a forward method! could you please clarify the reason? Tnx

Hi! The forward method is not needed, as we apply the encoder and decoder "by hand":

encoder_output = model.encode(encoder_input, encoder_mask) # (B, seq_len, d_model)