[Fix] ignore_index in SARLoss (#869)

* loss

* bug

* remove another fix
pull/884/head
JiangQing 2022-03-24 18:49:13 +08:00 committed by GitHub
parent 007871f2a1
commit 6512f0a0a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -79,7 +79,7 @@ class SARLoss(CELoss):
SARLoss assumes that the first input token is always `<SOS>`.
"""
def __init__(self, ignore_index=0, reduction='mean', **kwargs):
def __init__(self, ignore_index=-1, reduction='mean', **kwargs):
super().__init__(ignore_index, reduction)
def format(self, outputs, targets_dict):