Твоя маска ошибочна. Попробуй scores = scores.masked_fill(scores == 0, -np.inf) scores теперь выглядит так tensor([[1.4796, 1.2361, 1.2137, 0.9487, -inf, ...
確定! 回上一頁