class_docstr: # Parameters
  
  bias_direction : `BiasDirectionWrapper`
      Bias direction used by mitigator.
  embedding_layer : `torch.nn.Embedding`
      Embedding layer of base model.
  requires_grad : `bool`, optional (default=`True`)
      Option to enable gradient calculation for bias mitigator.
docstr: Called as forward hook.
docstr_tok: ["Called","as","forward","hook","."]
code: def __call__(self, module, module_in, module_out):
      """
      Called as forward hook.
      """
      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,
          self.predetermined_bias_direction.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 LinearBiasMitigatorWrapper obj's underlying member method code with example usage: obj.__call__(module, module_in, module_out) and returns: module_out