code: def _forward_self_attn(
      self, norm_layer_in, dec_mask, step, return_attn=False
  ):
      if self.self_attn_type in ["scaled-dot", "scaled-dot-flash"]:
          return self.self_attn(
              norm_layer_in,
              norm_layer_in,
              norm_layer_in,
              mask=dec_mask,
              sliding_window=self.sliding_window,
              step=step,
              return_attn=return_attn,
          )
      elif self.self_attn_type == "average":
          return self.self_attn(norm_layer_in, mask=dec_mask, step=step)
      else:
          raise ValueError(
              f"self attention {type(self.self_attn)} not supported"
          )
  
imports: import torch
  import torch.nn
  from onmt.decoders.decoder import DecoderBase
  from onmt.modules import MultiHeadedAttention, AverageAttention
  from onmt.modules.position_ffn import PositionwiseFeedForward
  from onmt.modules.position_ffn import ActivationFunction
  from onmt.modules.moe import MoE
  from onmt.utils.misc import sequence_mask
  from onmt.modules.rmsnorm import RMSNorm
label_desc: Use image node_id 6 for calling the TransformerDecoderLayerBase obj's underlying member method code with example usage: obj._forward_self_attn(norm_layer_in, dec_mask, step, return_attn) and returns: self, self