class_docstr: Transducer joint
  Detail of this loss function can be found in: Sequence Transduction with Recurrent Neural 
  Networks
  
  Arguments:
      pack_output (bool, optional): whether to pack the output in a compact form with don't-care 
      data being removed. (default: False)
      relu (bool, optional): apply ReLU to the output of the joint operation. Requires opt=1  
      (default: False)
      dropout (bool, optional): apply dropout to the output of the joint operation. Requires opt=1  
      (default: False)
      opt (int, optional): pick the optimization level in [0, 1]. opt=1 picks a tiled algorithm. 
          (default: 1)
      fwd_tile_size (int, optional): tile size used in forward operation. This argument will be 
      ignored if opt != 1. (default: 4) 
      dropout_prob (float, optional): dropout probability. (default: 0.0)
      probe_mask (bool, optional): a flag used to probe the mask generated by ReLU and/or dropout
      operation. When this argument is set to True, the mask can be accessed through 
      self.mask_probe. (default: false)
class_docstr_tok: ["Transducer","joint","Detail","of","this","loss","function","can","be","found","in",":","Sequence","Transduction","with","Recurrent","Neural","Networks","Arguments",":","pack_output","(","bool",",","optional",")",":","whether","to","pack","the","output","in","a","compact","form","with","don't-care","data","being","removed",".","(","default",":","False",")","relu","(","bool",",","optional",")",":","apply","ReLU","to","the","output","of","the","joint","operation",".","Requires","opt=1","(","default",":","False",")","dropout","(","bool",",","optional",")",":","apply","dropout","to","the","output","of","the","joint","operation",".","Requires","opt=1","(","default",":","False",")","opt","(","int",",","optional",")",":","pick","the","optimization","level","in","[","0",",","1","]",".","opt=1","picks","a","tiled","algorithm",".","(","default",":","1",")","fwd_tile_size","(","int",",","optional",")",":","tile","size","used","in","forward","operation",".","This","argument","will","be","ignored","if","opt","!","=","1",".","(","default",":","4",")","dropout_prob","(","float",",","optional",")",":","dropout","probability",".","(","default",":","0.0",")","probe_mask","(","bool",",","optional",")",":","a","flag","used","to","probe","the","mask","generated","by","ReLU","and\/or","dropout","operation",".","When","this","argument","is","set","to","True",",","the","mask","can","be","accessed","through","self.mask_probe",".","(","default",":","false",")"]
code: def __init__(
      self,
      pack_output=False,
      relu=False,
      dropout=False,
      opt=1,
      fwd_tile_size=4,
      dropout_prob=0,
      probe_mask=False,
  ):
      super(TransducerJoint, self).__init__()
      self.pack_output = pack_output
      self.relu = relu
      self.dropout = dropout
      self.dropout_prob = dropout_prob
      self.opt = opt
      self.fwd_tile_size = fwd_tile_size
      self.dummy_batch_offset = torch.empty(0)
      masked = self.relu or self.dropout
      self.mask_probe = [] if masked and probe_mask else None
      if masked and opt != 1:
          raise NotImplementedError(
              "ReLU and dropout fusion is only supported with opt=1"
          )
  
file_path: apex/apex/contrib/transducer/transducer.py
imports: import torch
  import transducer_loss_cuda
  import transducer_joint_cuda
label_desc: Use image node_id 1 to create a new TransducerJoint object from inherited base classes: torch.nn with example: obj = TransducerJoint(pack_output, relu, dropout, opt, fwd_tile_size, dropout_prob, probe_mask)