Unverified Commit edb314ae authored by sungho-ham's avatar sungho-ham Committed by GitHub
Browse files

Fix torch.ones usage in xlnet (#28471)



Fix xlnet torch.ones usage
Co-authored-by: default avatarsungho-ham <sungho.ham@linecorp.com>
parent c45ef1c0
......@@ -976,7 +976,7 @@ class XLNetModel(XLNetPreTrainedModel):
v [0 0 0 0 0 0 0 0 0] [1 1 1 1 0 0 0 0 0]
"""
mask = torch.ones(qlen, qlen + mlen, self.device)
mask = torch.ones((qlen, qlen + mlen), device=self.device)
if self.same_length:
mask_lo = mask[:, :qlen].tril(-1)
mask.triu_(mlen + 1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment