class_docstr: Computes the softmax of a 2d, 3d, or 4d input tensor.
  
  Arguments
  ---------
  apply_log : bool
      Whether to apply the log function before softmax.
  dim : int
      If the dimension where softmax is applied.
  reshape: bool
      whether to apply reshaping (true by default)
  dtype: torch.dtype
      dtype of the output tensor
  
  Example
  -------
  >>> classifier = Softmax()
  >>> inputs = torch.rand(10, 50, 40)
  >>> output = classifier(inputs)
  >>> output.shape
  torch.Size([10, 50, 40])
class_docstr_tok: ["Computes","the","softmax","of","a","2d",",","3d",",","or","4d","input","tensor",".","Arguments","--","--","--","--","-","apply_log",":","bool","Whether","to","apply","the","log","function","before","softmax",".","dim",":","int","If","the","dimension","where","softmax","is","applied",".","reshape",":","bool","whether","to","apply","reshaping","(","true","by","default",")","dtype",":","torch.dtype","dtype","of","the","output","tensor","Example","--","--","--","-",">",">",">","classifier","=","Softmax","(",")",">",">",">","inputs","=","torch.rand","(","10",",","50",",","40",")",">",">",">","output","=","classifier","(","inputs",")",">",">",">","output.shape","torch.Size","(","[","10",",","50",",","40","]",")"]
code: def __init__(
      self, apply_log=False, dim=-1, reshape=True, dtype=torch.float32
  ):
      super().__init__()
  
      if apply_log:
          self.act = F.log_softmax
      else:
          self.act = F.softmax
  
      self.dim = dim
      self.reshape = reshape
      self.dtype = dtype
  
file_path: speechbrain/speechbrain/nnet/activations.py
imports: import torch
  import logging
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new Softmax object from inherited base classes: torch.nn with example: obj = Softmax(apply_log, dim, reshape, dtype)