class_docstr: An implementation of residual addition of an adapter module with its input for the MHA Adapters.
docstr: Compute the output of a single adapter to some input.
  
  Args:
      input: Original output tensor of the module, or the output of the previous adapter (if more than
          one adapters are enabled).
      adapter: The adapter module that is currently required to perform the forward pass.
      module: The calling module, in its entirety. It is a module that implements `AdapterModuleMixin`,
          therefore the strategy can access all other adapters in this module via `module.adapter_layer`.
  
  Returns:
      The result tensor, after one of the active adapters has finished its forward passes.
docstr_tok: ["Compute","the","output","of","a","single","adapter","to","some","input",".","Args",":","input",":","Original","output","tensor","of","the","module",",","or","the","output","of","the","previous","adapter","(","if","more","than","one","adapters","are","enabled",")",".","adapter",":","The","adapter","module","that","is","currently","required","to","perform","the","forward","pass",".","module",":","The","calling","module",",","in","its","entirety",".","It","is","a","module","that","implements","`","AdapterModuleMixin","`",",","therefore","the","strategy","can","access","all","other","adapters","in","this","module","via","`","module.adapter_layer","`",".","Returns",":","The","result","tensor",",","after","one","of","the","active","adapters","has","finished","its","forward","passes","."]
code: def compute_output(
      self,
      input: torch.Tensor,
      adapter: torch.nn.Module,
      *,
      module: "AdapterModuleMixin",
  ) -> torch.Tensor:
      """
      Compute the output of a single adapter to some input.
  
      Args:
          input: Original output tensor of the module, or the output of the previous adapter (if more than
              one adapters are enabled).
          adapter: The adapter module that is currently required to perform the forward pass.
          module: The calling module, in its entirety. It is a module that implements `AdapterModuleMixin`,
              therefore the strategy can access all other adapters in this module via `module.adapter_layer`.
  
      Returns:
          The result tensor, after one of the active adapters has finished its forward passes.
      """
      if isinstance(input, (list, tuple)):
          out = adapter(*input)
      elif isinstance(input, dict):
          out = adapter(**input)
      else:
          out = adapter(input)
      return out
  
imports: import math
  from dataclasses import dataclass, field
  from typing import Any, Optional
  import torch
  from torch import nn
  from nemo.collections.asr.parts.submodules import multi_head_attention
  from nemo.collections.common.parts import adapter_modules
  from nemo.core.classes.mixins import adapter_mixin_strategies
label_desc: Use image node_id 2 for calling the MHAResidualAddAdapterStrategy obj's underlying member method code with example usage: obj.compute_output(input, adapter) and returns: out