class_docstr: # Parameters
  
  embedding_layer : `torch.nn.Embedding`
      Embedding layer of base model.
  seed_word_pairs_file : `Union[PathLike, str]`
      Path of file containing seed word pairs.
  tokenizer : `Tokenizer`
      Tokenizer used to tokenize seed words.
  mitigator_vocab : `Vocabulary`, optional (default=`None`)
      Vocabulary of tokenizer. If `None`, assumes tokenizer is of
      type `PreTrainedTokenizer` and uses tokenizer's `vocab` attribute.
  namespace : `str`, optional (default=`"tokens"`)
      Namespace of mitigator_vocab to use when tokenizing.
      Disregarded when mitigator_vocab is `None`.
docstr: Called as forward hook.
docstr_tok: ["Called","as","forward","hook","."]
code: def __call__(self, module, module_in, module_out):
      """
      Called as forward hook.
      """
      # embed subword token IDs and mean pool to get
      # embedding of original word
      ids1_embeddings = []
      for i in self.ids1:
          i = i.to(module.weight.device)
          ids1_embeddings.append(
              torch.mean(module.forward(i), dim=0, keepdim=True)
          )
      ids2_embeddings = []
      for i in self.ids2:
          i = i.to(module.weight.device)
          ids2_embeddings.append(
              torch.mean(module.forward(i), dim=0, keepdim=True)
          )
      ids1_embeddings = torch.cat(ids1_embeddings)
      ids2_embeddings = torch.cat(ids2_embeddings)
  
      module_out_size = module_out.size()
      # flatten tensor except for last dimension
      module_out = module_out.flatten(end_dim=-2)
      module_out = self.mitigator(
          module_out,
          ids1_embeddings.to(module_out.device),
          ids2_embeddings.to(module_out.device),
      )
      return module_out.reshape(module_out_size)
  
imports: import torch
  from typing import Union, Optional
  from os import PathLike
  from allennlp.fairness.bias_mitigators import HardBiasMitigator, LinearBiasMitigator, INLPBiasMitigator, OSCaRBiasMitigator
  from allennlp.fairness.bias_direction_wrappers import BiasDirectionWrapper
  from allennlp.fairness.bias_utils import load_word_pairs
  from allennlp.common import Registrable
  from allennlp.data.tokenizers.tokenizer import Tokenizer
  from allennlp.data import Vocabulary
label_desc: Use image node_id 2 for calling the INLPBiasMitigatorWrapper obj's underlying member method code with example usage: obj.__call__(module, module_in, module_out) and returns: module_out