class_docstr: A single block of the Squeezeformer encoder.
  
  Args:
      d_model (int): input dimension of MultiheadAttentionMechanism and PositionwiseFeedForward
      d_ff (int): hidden dimension of PositionwiseFeedForward
      n_heads (int): number of heads for multi-head attention
      conv_kernel_size (int): kernel size for depthwise convolution in convolution module
      dropout (float): dropout probabilities for linear layers
      dropout_att (float): dropout probabilities for attention distributions
      adaptive_scale (bool): Whether to scale the inputs to each component by affine `scale` and `bias` layer.
          Or use a fixed scale=1 and bias=0.
class_docstr_tok: ["A","single","block","of","the","Squeezeformer","encoder",".","Args",":","d_model","(","int",")",":","input","dimension","of","MultiheadAttentionMechanism","and","PositionwiseFeedForward","d_ff","(","int",")",":","hidden","dimension","of","PositionwiseFeedForward","n_heads","(","int",")",":","number","of","heads","for","multi-head","attention","conv_kernel_size","(","int",")",":","kernel","size","for","depthwise","convolution","in","convolution","module","dropout","(","float",")",":","dropout","probabilities","for","linear","layers","dropout_att","(","float",")",":","dropout","probabilities","for","attention","distributions","adaptive_scale","(","bool",")",":","Whether","to","scale","the","inputs","to","each","component","by","affine","`","scale","`","and","`","bias","`","layer",".","Or","use","a","fixed","scale=1","and","bias=0","."]
docstr: Perform the forward step of a single adapter module on some input data.
  
  **Note**: Subclasses can override this method to accommodate more complicate adapter forward steps.
  
  Args:
      input: Dictionary of packed tensors. The dict should contain at least
          `x`: output tensor
          `loc`: Semantic location in module where this adapter was called
          `att_mask`: Optional, Attention mask
          `pos_emb`: Optional, Positional Embedding for Relative Positional Encoding.
          The output tensor of the calling module is the input to the first adapter, whose output
          is then chained to the next adapter until all adapters are consumed.
      adapter_module: The adapter module that is currently required to perform the forward pass.
      adapter_name: The resolved name of the adapter that is undergoing the current forward pass.
      adapter_strategy: A subclass of `AbstractAdapterStrategy`, that determines how the
          output of the adapter should be merged with the input, or if it should be merged at all.
  
  Returns:
      The result tensor, after the current active adapter has finished its forward pass.
docstr_tok: ["Perform","the","forward","step","of","a","single","adapter","module","on","some","input","data",".","*","*","Note","*","*",":","Subclasses","can","override","this","method","to","accommodate","more","complicate","adapter","forward","steps",".","Args",":","input",":","Dictionary","of","packed","tensors",".","The","dict","should","contain","at","least","`","x","`",":","output","tensor","`","loc","`",":","Semantic","location","in","module","where","this","adapter","was","called","`","att_mask","`",":","Optional",",","Attention","mask","`","pos_emb","`",":","Optional",",","Positional","Embedding","for","Relative","Positional","Encoding",".","The","output","tensor","of","the","calling","module","is","the","input","to","the","first","adapter",",","whose","output","is","then","chained","to","the","next","adapter","until","all","adapters","are","consumed",".","adapter_module",":","The","adapter","module","that","is","currently","required","to","perform","the","forward","pass",".","adapter_name",":","The","resolved","name","of","the","adapter","that","is","undergoing","the","current","forward","pass",".","adapter_strategy",":","A","subclass","of","`","AbstractAdapterStrategy","`",",","that","determines","how","the","output","of","the","adapter","should","be","merged","with","the","input",",","or","if","it","should","be","merged","at","all",".","Returns",":","The","result","tensor",",","after","the","current","active","adapter","has","finished","its","forward","pass","."]
code: def forward_single_enabled_adapter_(
      self,
      input: dict,
      adapter_module: torch.nn.Module,
      *,
      adapter_name: str,
      adapter_strategy: "nemo.core.classes.mixins.adapter_mixin_strategies.AbstractAdapterStrategy",
  ):
      """
      Perform the forward step of a single adapter module on some input data.
  
      **Note**: Subclasses can override this method to accommodate more complicate adapter forward steps.
  
      Args:
          input: Dictionary of packed tensors. The dict should contain at least
              `x`: output tensor
              `loc`: Semantic location in module where this adapter was called
              `att_mask`: Optional, Attention mask
              `pos_emb`: Optional, Positional Embedding for Relative Positional Encoding.
              The output tensor of the calling module is the input to the first adapter, whose output
              is then chained to the next adapter until all adapters are consumed.
          adapter_module: The adapter module that is currently required to perform the forward pass.
          adapter_name: The resolved name of the adapter that is undergoing the current forward pass.
          adapter_strategy: A subclass of `AbstractAdapterStrategy`, that determines how the
              output of the adapter should be merged with the input, or if it should be merged at all.
  
      Returns:
          The result tensor, after the current active adapter has finished its forward pass.
      """
      # (input: torch.Tensor, adapter: torch.nn.Module, *, module: 'AdapterModuleMixin')
      x = input["x"]
      loc = input["loc"]
      att_mask = input.get("att_mask", None)
      pos_emb = input.get("pos_emb", None)
  
      if (
          isinstance(adapter_module, adapter_modules.LinearAdapter)
          and loc == "post"
      ):
          output = adapter_strategy(x, adapter_module, module=self)
  
      elif (
          isinstance(adapter_module, MultiHeadAttention)
          and loc == "mha"
      ):
          if self.self_attention_model == "rel_pos":
              x = dict(
                  query=x,
                  key=x,
                  value=x,
                  mask=att_mask,
                  pos_emb=pos_emb,
              )
              output = adapter_strategy(x, adapter_module, module=self)
  
          elif self.self_attention_model == "abs_pos":
              x = dict(query=x, key=x, value=x, mask=att_mask)
              output = adapter_strategy(x, adapter_module, module=self)
  
          else:
              raise ValueError(
                  f"Unsupported value of self_attention_model , provided {self.self_attention_model}!"
              )
  
      else:
          # No adapter compatible, skip
          output = x
  
      input["x"] = output
  
      return input
  
imports: import torch
  from torch import nn
  from torch.nn import LayerNorm
  from nemo.collections.asr.parts.submodules.conformer_modules import ConformerConvolution, ConformerFeedForward
  from nemo.collections.asr.parts.submodules.multi_head_attention import MultiHeadAttention, RelPositionMultiHeadAttention
  from nemo.collections.common.parts import adapter_modules
  from nemo.core.classes.mixins import AccessMixin
  from nemo.core.classes.mixins.adapter_mixins import AdapterModuleMixin
label_desc: Use image node_id 3 for calling the SqueezeformerLayer obj's underlying member method code with example usage: obj.forward_single_enabled_adapter_(input, adapter_module) and returns: input