x-transformers icon indicating copy to clipboard operation
x-transformers copied to clipboard

Question: decoder attention mask?

Open yzhang-github-pub opened this issue 3 years ago • 1 comments

I am trying to use Xtransformer for language translation. In the original transformer paper, target input to decoder is masked such that attentions are only to current and past tokens, not future tokens. I didn't find a way to pass such a mask. Please advice.

yzhang-github-pub avatar Jul 27 '22 13:07 yzhang-github-pub

If you use the Decoder module, the causal mask is automatically added

lucidrains avatar Jul 27 '22 14:07 lucidrains