class_docstr: A unit dropout layer that's designed for input of sequence units (e.g., word sequence, char sequence, etc.).
  Given a sequence of unit indices, this layer randomly set some of them to be a replacement id (usually set to be <UNK>).
class_docstr_tok: ["A","unit","dropout","layer","that","'s","designed","for","input","of","sequence","units","(","e.g.",",","word","sequence",",","char","sequence",",","etc.",")",".","Given","a","sequence","of","unit","indices",",","this","layer","randomly","set","some","of","them","to","be","a","replacement","id","(","usually","set","to","be","<","UNK",">",")","."]
docstr: :param: x must be a LongTensor of unit indices. 
docstr_tok: [":","param",":","x","must","be","a","LongTensor","of","unit","indices","."]
code: def forward(self, x):
      """:param: x must be a LongTensor of unit indices."""
      if not self.training or self.dropprob == 0:
          return x
      masksize = [y for y in x.size()]
      dropmask = torch.rand(*masksize, device=x.device) < self.dropprob
      res = x.masked_fill(dropmask, self.replacement_id)
      return res
  
file_path: stanza/stanza/models/common/dropout.py
imports: import torch
  import torch.nn
label_desc: Use image node_id 2 for calling the SequenceUnitDropout obj's underlying member method code with example usage: obj.forward(x) and returns: res, x