Transformer icon indicating copy to clipboard operation
Transformer copied to clipboard

RuntimeError: The size of tensor a (127) must match the size of tensor b (40) at non-singleton dimension 3

Open shefali1234 opened this issue 4 years ago • 0 comments

if mask is not None:
mask = mask.unsqueeze(1) scores = scores.masked_fill(mask == 0, -1e9)
scores = F.softmax(scores, dim=-1)

runtime error in scores.masked_fill(mask == 0, -1e9)
Same for this: x = x + Variable(self.pe[:,:seq_len], requires_grad=False).cuda() x = x + pe return self.dropout(x)

Please help

shefali1234 avatar May 08 '20 09:05 shefali1234