Embedding is handled simply in pytorch: class Embedder(nn.Module): ... scores = scores.masked_fill(mask == 0, -1e9)scores = F.softmax(scores, dim=-1)
確定! 回上一頁