class_docstr: This is an implementation of the loss function accompanying the adaptive softmax approximation for
  graphical processing units (GPU), described in the paper "Efficient softmax approximation for GPUs"
  (http://arxiv.org/abs/1609.04309).
class_docstr_tok: ["This","is","an","implementation","of","the","loss","function","accompanying","the","adaptive","softmax","approximation","for","graphical","processing","units","(","GPU",")",",","described","in","the","paper","``","Efficient","softmax","approximation","for","GPUs","''","(","http",":","\/\/arxiv.org\/abs\/1609.04309",")","."]
code: def __init__(self, task, sentence_avg):
      super().__init__(task)
      self.sentence_avg = sentence_avg
  
file_path: fairseq/fairseq/criterions/adaptive_loss.py
imports: import math
  from dataclasses import dataclass
  import torch.nn.functional
  from fairseq import utils
  from fairseq.logging import metrics
  from fairseq.criterions import FairseqCriterion, register_criterion
  from fairseq.dataclass import FairseqDataclass
  from fairseq.dataclass.constants import DDP_BACKEND_CHOICES
  from omegaconf import II
label_desc: Use image node_id 1 to create a new AdaptiveLoss object from inherited base classes: FairseqCriterion with example: obj = AdaptiveLoss(task, sentence_avg)