class_docstr: Class for dropping out embeddings by zero'ing out parameters in the
  embedding matrix.
  
  This is equivalent to dropping out particular words, e.g., in the sentence
  'the quick brown fox jumps over the lazy dog', dropping out 'the' would
  lead to the sentence '### quick brown fox jumps over ### lazy dog' (in the
  embedding vector space).
  
  See 'A Theoretically Grounded Application of Dropout in Recurrent Neural
  Networks', (Gal and Ghahramani, 2016).
class_docstr_tok: ["Class","for","dropping","out","embeddings","by","zero'ing","out","parameters","in","the","embedding","matrix",".","This","is","equivalent","to","dropping","out","particular","words",",","e.g.",",","in","the","sentence","'the","quick","brown","fox","jumps","over","the","lazy","dog","'",",","dropping","out","'the","'","would","lead","to","the","sentence","'","#","#","#","quick","brown","fox","jumps","over","#","#","#","lazy","dog","'","(","in","the","embedding","vector","space",")",".","See","'","A","Theoretically","Grounded","Application","of","Dropout","in","Recurrent","Neural","Networks","'",",","(","Gal","and","Ghahramani",",","2016",")","."]
docstr: Embeds `inputs` with the dropped out embedding weight matrix.
docstr_tok: ["Embeds","`","inputs","`","with","the","dropped","out","embedding","weight","matrix","."]
code: def forward(self, inputs):  # pylint:disable=arguments-differ
      """Embeds `inputs` with the dropped out embedding weight matrix."""
      if self.training:
          dropout = self.dropout
      else:
          dropout = 0
  
      if dropout:
          mask = self.weight.data.new(self.weight.size(0), 1)
          mask.bernoulli_(1 - dropout)
          mask = mask.expand_as(self.weight)
          mask = mask / (1 - dropout)
          masked_weight = self.weight * Variable(mask)
      else:
          masked_weight = self.weight
      if self.scale and self.scale != 1:
          masked_weight = masked_weight * self.scale
  
      return F.embedding(
          inputs,
          masked_weight,
          max_norm=self.max_norm,
          norm_type=self.norm_type,
          scale_grad_by_freq=self.scale_grad_by_freq,
          sparse=self.sparse,
      )
  
imports: import numpy
  import collections
  import torch
  from torch import nn
  import torch.nn.functional
  from torch.autograd import Variable
  import models.shared_base
  import utils
label_desc: Use image node_id 2 for calling the EmbeddingDropout obj's underlying member method code with example usage: obj.forward(inputs) and returns: F