class_docstr: Apply dropout with probability `embed_p` to an embedding layer `emb`.
class_docstr_tok: ["Apply","dropout","with","probability","`","embed_p","`","to","an","embedding","layer","`","emb","`","."]
code: def forward(self, words, scale=None):
      if self.training and self.embed_p != 0:
          size = (self.emb.weight.size(0), 1)
          mask = dropout_mask(self.emb.weight.data, size, self.embed_p)
          masked_embed = self.emb.weight * mask
      else:
          masked_embed = self.emb.weight
      if scale:
          masked_embed.mul_(scale)
      return F.embedding(
          words,
          masked_embed,
          ifnone(self.emb.padding_idx, -1),
          self.emb.max_norm,
          self.emb.norm_type,
          self.emb.scale_grad_by_freq,
          self.emb.sparse,
      )
  
imports: from __future__ import annotations
  from ...data.all import *
  from ..core import *
label_desc: Use image node_id 2 for calling the EmbeddingDropout obj's underlying member method code with example usage: obj.forward(words, scale) and returns: F