mirror of
https://gitee.com/fastnlp/fastNLP.git
synced 2024-11-30 03:07:59 +08:00
Merge pull request #139 from fastnlp/choosewhatulike-patch-1
fix mask bug in star-transformer
This commit is contained in:
commit
56410c9e31
@ -46,6 +46,7 @@ class StarTransformer(nn.Module):
|
||||
return f(x.permute(0, 2, 3, 1)).permute(0, 3, 1, 2)
|
||||
|
||||
B, L, H = data.size()
|
||||
mask = (mask == 0) # flip the mask for masked_fill_
|
||||
smask = torch.cat([torch.zeros(B, 1, ).byte().to(mask), mask], 1)
|
||||
|
||||
embs = data.permute(0, 2, 1)[:,:,:,None] # B H L 1
|
||||
|
Loading…
Reference in New Issue
Block a user