code: def __init__(self, input_size, cutoffs, scale_down=4):
      super().__init__()
      self.input_size = input_size
      self.cutoffs = cutoffs
      self.output_size = cutoffs[0] + len(cutoffs) - 1
      self.head = nn.Linear(input_size, self.output_size)
      self.tail = nn.ModuleList()
      for i in range(len(cutoffs) - 1):
          seq = nn.Sequential(
              nn.Linear(input_size, input_size // scale_down, False),
              nn.Linear(
                  input_size // scale_down,
                  cutoffs[i + 1] - cutoffs[i],
                  False,
              ),
          )
          self.tail.append(seq)
  
file_path: TextAttack/textattack/constraints/grammaticality/language_models/learning_to_write/adaptive_softmax.py
imports: import torch
  from torch import nn
  from torch.autograd import Variable
  from torch.nn.functional import log_softmax
  import textattack
label_desc: Use image node_id 1 to create a new AdaptiveSoftmax object from inherited base classes: nn with example: obj = AdaptiveSoftmax(input_size, cutoffs, scale_down)