pytorch-transformer icon indicating copy to clipboard operation
pytorch-transformer copied to clipboard

Refactor Causal Mask Generation for Simplicity

Open sanzgadea opened this issue 1 year ago • 0 comments

I updated the causal_mask function to create a lower triangular matrix using torch.tril, which is more concise and clearer than inverting a mask generated with torch.triu. The functionality of the code is preserved. I hope this helps :)

sanzgadea avatar Apr 22 '24 16:04 sanzgadea