Store task in the criterion base class
Summary: Pull Request resolved:
@@ -13,6 +13,7 @@ class FairseqCriterion(_Loss):
def __init__(self, args, task):
super().__init__()
self.args = args
+ self.task = task
self.padding_idx = task.target_dictionary.pad() if task.target_dictionary is not None else -100
@staticmethod
