Commit c811e0e0 authored by Myle Ott's avatar Myle Ott Committed by Facebook Github Bot
Browse files

Store task in the criterion base class

Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/737

Differential Revision: D16377805

Pulled By: myleott

fbshipit-source-id: 1e090a02ff4fbba8695173f57d3cc5b88ae98bbf
parent 8af55542
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment