    def get_targets(self, sample, net_output):
        """Get targets from either the sample or the net's output."""
        return sample["target"]
Get targets from either the sample or the net's output.
fairseq/models/fairseq_model.py