class_docstr: A variant of dropout layer that consistently drops out the same parameters over time. Also known as the variational dropout. 
  This implementation was modified from the LockedDropout implementation in the flair library (https://github.com/zalandoresearch/flair).
class_docstr_tok: ["A","variant","of","dropout","layer","that","consistently","drops","out","the","same","parameters","over","time",".","Also","known","as","the","variational","dropout",".","This","implementation","was","modified","from","the","LockedDropout","implementation","in","the","flair","library","(","https",":","\/\/github.com\/zalandoresearch\/flair",")","."]
code: def forward(self, x):
      if not self.training or self.dropprob == 0:
          return x
  
      if not self.batch_first:
          m = x.new_empty(
              1, x.size(1), x.size(2), requires_grad=False
          ).bernoulli_(1 - self.dropprob)
      else:
          m = x.new_empty(
              x.size(0), 1, x.size(2), requires_grad=False
          ).bernoulli_(1 - self.dropprob)
  
      mask = m.div(1 - self.dropprob).expand_as(x)
      return mask * x
  
file_path: stanza/stanza/models/common/dropout.py
imports: import torch
  import torch.nn
label_desc: Use image node_id 2 for calling the LockedDropout obj's underlying member method code with example usage: obj.forward(x) and returns: unknown, x