class_docstr: A wrapper around the embedding layer, which can be randomly initialized or
  loaded from a .npy file. Also supports normalization of embeddings to have
  zero mean and unit variance (weighted by token frequency) - this is useful
  for example when creating adversarial perturbations of the embeddings that
  should have norms relative to the embeddings' norms.
class_docstr_tok: ["A","wrapper","around","the","embedding","layer",",","which","can","be","randomly","initialized","or","loaded","from","a",".npy","file",".","Also","supports","normalization","of","embeddings","to","have","zero","mean","and","unit","variance","(","weighted","by","token","frequency",")","-","this","is","useful","for","example","when","creating","adversarial","perturbations","of","the","embeddings","that","should","have","norms","relative","to","the","embeddings","'","norms","."]
code: def init_normalization_if_needed(self):
      if not self.normalize:
          return
  
      self.mean = nn.Parameter(
          self.weight.mean(dim=0), requires_grad=False
      )
      self.var = nn.Parameter(
          self.weight.var(dim=0), requires_grad=False
      )
  
imports: import abc
  import math
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import utils
  from fairseq.models import FairseqIncrementalDecoder, transformer
  from pytorch_translate import rnn_cell, utils, vocab_reduction
  from pytorch_translate.research.lexical_choice import lexical_translation
label_desc: Use image node_id 3 for calling the Embedding obj's underlying member method code with example usage: obj.init_normalization_if_needed() without return types