code: def __init__(self, dim=0):
      self.dim = dim
      super(LogSparsemax, self).__init__()
  
file_path: OpenNMT-py/onmt/modules/sparse_activations.py
imports: import torch
  from torch.autograd import Function
  from torch.cuda.amp import custom_fwd, custom_bwd
  import torch.nn
label_desc: Use image node_id 1 to create a new LogSparsemax object from inherited base classes: nn with example: obj = LogSparsemax(dim)