code: def forward(self, inp):
      assert len(inp.size()) == 2
      output = [self.head(inp)]
      for i in range(len(self.id)):
          if self.id[i] is not None:
              output.append(
                  self.tail[i](inp.index_select(0, self.id[i]))
              )
          else:
              output.append(None)
      return output
  
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 4 for calling the AdaptiveSoftmax obj's underlying member method code with example usage: obj.forward(inp) and returns: output