class_docstr: ASRModuleMixin is a mixin class added to ASR models in order to add methods that are specific
  to a particular instantiation of a module inside of an ASRModel.
  
  Each method should first check that the module is present within the subclass, and support additional
  functionality if the corresponding module is present.
docstr: Update the self_attention_model if function is available in encoder.
  
  Args:
      self_attention_model (str): type of the attention layer and positional encoding
          'rel_pos': relative positional embedding and Transformer-XL
          'rel_pos_local_attn': relative positional embedding and Transformer-XL with local attention using
              overlapping windows. Attention context is determined by att_context_size parameter.
          'abs_pos': absolute positional embedding and Transformer
          If None is provided, the self_attention_model isn't changed. Defauts to None.
      att_context_size (List[int]): List of 2 ints corresponding to left and right attention context sizes,
          or None to keep as it is. Defauts to None.
      update_config (bool): Whether to update the config or not with the new attention model.
          Defaults to True.
docstr_tok: ["Update","the","self_attention_model","if","function","is","available","in","encoder",".","Args",":","self_attention_model","(","str",")",":","type","of","the","attention","layer","and","positional","encoding","'rel_pos","'",":","relative","positional","embedding","and","Transformer-XL","'rel_pos_local_attn","'",":","relative","positional","embedding","and","Transformer-XL","with","local","attention","using","overlapping","windows",".","Attention","context","is","determined","by","att_context_size","parameter",".","'abs_pos","'",":","absolute","positional","embedding","and","Transformer","If","None","is","provided",",","the","self_attention_model","is","n't","changed",".","Defauts","to","None",".","att_context_size","(","List","[","int","]",")",":","List","of","2","ints","corresponding","to","left","and","right","attention","context","sizes",",","or","None","to","keep","as","it","is",".","Defauts","to","None",".","update_config","(","bool",")",":","Whether","to","update","the","config","or","not","with","the","new","attention","model",".","Defaults","to","True","."]
code: def change_attention_model(
      self,
      self_attention_model: str = None,
      att_context_size: List[int] = None,
      update_config: bool = True,
  ):
      """
      Update the self_attention_model if function is available in encoder.
  
      Args:
          self_attention_model (str): type of the attention layer and positional encoding
              'rel_pos': relative positional embedding and Transformer-XL
              'rel_pos_local_attn': relative positional embedding and Transformer-XL with local attention using
                  overlapping windows. Attention context is determined by att_context_size parameter.
              'abs_pos': absolute positional embedding and Transformer
              If None is provided, the self_attention_model isn't changed. Defauts to None.
          att_context_size (List[int]): List of 2 ints corresponding to left and right attention context sizes,
              or None to keep as it is. Defauts to None.
          update_config (bool): Whether to update the config or not with the new attention model.
              Defaults to True.
      """
      if self_attention_model is None and att_context_size is None:
          return
  
      if not hasattr(self, "encoder"):
          logging.info(
              "Could not change the self_attention_model in encoder "
              "since the model provided does not contain an `encoder` module in its config."
          )
          return
  
      if not hasattr(self.encoder, "change_attention_model"):
          logging.info(
              "Model encoder doesn't have a change_attention_model method "
          )
          return
  
      self.encoder.change_attention_model(
          self_attention_model,
          att_context_size,
          update_config,
          self.device,
      )
      if update_config:
          with open_dict(self.cfg):
              self.cfg.encoder.self_attention_model = (
                  self_attention_model
              )
              self.cfg.encoder.att_context_size = att_context_size
  
imports: import os
  from abc import ABC, abstractmethod
  from typing import List
  import torch
  from omegaconf import DictConfig, OmegaConf, open_dict
  import nemo.collections.asr.models
  from nemo.collections.asr.parts.mixins.asr_adapter_mixins import ASRAdapterModelMixin
  from nemo.collections.asr.parts.mixins.streaming import StreamingEncoder
  from nemo.collections.asr.parts.utils import asr_module_utils
  from nemo.collections.asr.parts.utils.rnnt_utils import Hypothesis
  from nemo.collections.common import tokenizers
  from nemo.utils import logging
label_desc: Use image node_id 2 for calling the ASRModuleMixin obj's underlying member method code with example usage: obj.change_attention_model(_attention_model, att_context_size, update_config) without return types