
import math
from collections import OrderedDict

import torch
from packaging import version
from torch import Tensor, nn

from .utils import logging


UpperCAmelCase__						:	Any	     = logging.get_logger(__name__)






class UpperCAmelCase  (		nn.Module  ):





   '''simple docstring'''


   def __init__(   self	:				List[str]	):

      """simple docstring"""
      super().__init__()
      if version.parse(torch.__version__	) < version.parse('''1.12.0'''	):
         raise ImportError(
             F"""You are using torch=={torch.__version__}, but torch>=1.12.0 is required to use """
             '''PytorchGELUTanh. Please upgrade torch.'''	)


   def 					__magic_name__							(   self	:				Any     ,     lowerCAmelCase_	:				Tensor	):

      """simple docstring"""
      return nn.functional.gelu(lowerCAmelCase_     ,     approximate='''tanh'''	)






class UpperCAmelCase  (		nn.Module  ):





   '''simple docstring'''


   def 					__magic_name__							(   self	:				Tuple     ,     lowerCAmelCase_	:				Tensor	):

      """simple docstring"""
      return 0.5 * input * (1.0 + torch.tanh(math.sqrt(2.0 / math.pi	) * (input + 0.044715 * torch.pow(lowerCAmelCase_     ,     3.0	))	))






class UpperCAmelCase  (		nn.Module  ):





   '''simple docstring'''


   def __init__(   self	:				Tuple     ,     lowerCAmelCase_	:				bool = False	):

      """simple docstring"""
      super().__init__()
      if use_gelu_python:
         _A:    Union[str, Any]						     =			self._gelu_python
      else:
         _A:    Union[str, Any]						     =			nn.functional.gelu


   def 					__magic_name__							(   self	:				Union[str, Any]     ,     lowerCAmelCase_	:				Tensor	):

      """simple docstring"""
      return input * 0.5 * (1.0 + torch.erf(input / math.sqrt(2.0	)	))


   def 					__magic_name__							(   self	:				Any     ,     lowerCAmelCase_	:				Tensor	):

      """simple docstring"""
      return self.act(lowerCAmelCase_	)






class UpperCAmelCase  (		nn.Module  ):





   '''simple docstring'''


   def 					__magic_name__							(   self	:				Optional[int]     ,     lowerCAmelCase_	:				Tensor	):

      """simple docstring"""
      return 0.5 * input * (1.0 + torch.tanh(input * 0.7978845608 * (1.0 + 0.044715 * input * input)	))






class UpperCAmelCase  (		nn.Module  ):





   '''simple docstring'''


   def 					__magic_name__							(   self	:				Optional[int]     ,     lowerCAmelCase_	:				Tensor	):

      """simple docstring"""
      return input * torch.sigmoid(1.702 * input	)






class UpperCAmelCase  (		nn.Module  ):





   '''simple docstring'''


   def __init__(   self	:				str     ,     lowerCAmelCase_	:				float     ,     lowerCAmelCase_	:				float	):

      """simple docstring"""
      if min > max:
         raise ValueError(F"""min should be < max (got min: {min}, max: {max})"""	)

      super().__init__()
      _A:    Tuple						     =			min
      _A:    str						     =			max


   def 					__magic_name__							(   self	:				int     ,     lowerCAmelCase_	:				Tensor	):

      """simple docstring"""
      return torch.clip(gelu(lowerCAmelCase_	)     ,     self.min     ,     self.max	)






class UpperCAmelCase  (		nn.Module  ):





   '''simple docstring'''


   def __init__(   self	:				Optional[Any]	):

      """simple docstring"""
      super().__init__()
      _A:    Any						     =			math.sqrt(2 / math.pi	)


   def 					__magic_name__							(   self	:				Union[str, Any]     ,     lowerCAmelCase_	:				Tensor	):

      """simple docstring"""
      return 0.5 * input * (1 + torch.tanh(self.precomputed_constant * (input + 0.044715 * torch.pow(lowerCAmelCase_     ,     3	))	))






class UpperCAmelCase  (		nn.Module  ):





   '''simple docstring'''


   def 					__magic_name__							(   self	:				str     ,     lowerCAmelCase_	:				Tensor	):

      """simple docstring"""
      return nn.functional.silu(lowerCAmelCase_	)






class UpperCAmelCase  (		nn.Module  ):





   '''simple docstring'''


   def __init__(   self	:				Union[str, Any]	):

      """simple docstring"""
      super().__init__()
      if version.parse(torch.__version__	) < version.parse('''1.9.0'''	):
         _A:    Optional[Any]						     =			self._mish_python
      else:
         _A:    int						     =			nn.functional.mish


   def 					__magic_name__							(   self	:				Optional[int]     ,     lowerCAmelCase_	:				Tensor	):

      """simple docstring"""
      return input * torch.tanh(nn.functional.softplus(lowerCAmelCase_	)	)


   def 					__magic_name__							(   self	:				Any     ,     lowerCAmelCase_	:				Tensor	):

      """simple docstring"""
      return self.act(lowerCAmelCase_	)






class UpperCAmelCase  (		nn.Module  ):





   '''simple docstring'''


   def 					__magic_name__							(   self	:				Tuple     ,     lowerCAmelCase_	:				Tensor	):

      """simple docstring"""
      return input






class UpperCAmelCase  (		nn.Module  ):





   '''simple docstring'''


   def 					__magic_name__							(   self	:				Dict     ,     lowerCAmelCase_	:				List[str]     ,     lowerCAmelCase_	:				Tuple=0.707107     ,     lowerCAmelCase_	:				Union[str, Any]=0.282095	):

      """simple docstring"""
      _A:    Any						     =			(input - mu).div(sigma * math.sqrt(2.0	)	)
      return 0.5 * (1.0 + torch.erf(lowerCAmelCase_	))






class UpperCAmelCase  (		nn.Module  ):





   '''simple docstring'''


   def 					__magic_name__							(   self	:				Union[str, Any]     ,     lowerCAmelCase_	:				List[Any]	):

      """simple docstring"""
      _A:    Optional[int]						     =			nn.functional.relu(lowerCAmelCase_	)
      _A:    Any						     =			torch.square(lowerCAmelCase_	)
      return squared






class UpperCAmelCase  (		SCREAMING_SNAKE_CASE__  ):





   '''simple docstring'''


   def __getitem__(   self	:				List[Any]     ,     lowerCAmelCase_	:				Tuple	):

      """simple docstring"""
      _A:    Any						     =			super().__getitem__(lowerCAmelCase_	)
      _A     ,    _A:    List[str]						     =			content if isinstance(lowerCAmelCase_     ,     lowerCAmelCase_	) else (content, {})
      return cls(**lowerCAmelCase_	)

UpperCAmelCase__						:	List[str]	     = {
    'gelu': GELUActivation,
    'gelu_10': (ClippedGELUActivation, {'min': -10, 'max': 10}),
    'gelu_fast': FastGELUActivation,
    'gelu_new': NewGELUActivation,
    'gelu_python': (GELUActivation, {'use_gelu_python': True}),
    'gelu_pytorch_tanh': PytorchGELUTanh,
    'gelu_accurate': AccurateGELUActivation,
    'laplace': LaplaceActivation,
    'linear': LinearActivation,
    'mish': MishActivation,
    'quick_gelu': QuickGELUActivation,
    'relu': nn.ReLU,
    'relu2': ReLUSquaredActivation,
    'relu6': nn.ReLUa,
    'sigmoid': nn.Sigmoid,
    'silu': SiLUActivation,
    'swish': SiLUActivation,
    'tanh': nn.Tanh,
}
UpperCAmelCase__						:	List[str]	     = ClassInstantier(ACTaCLS)






def     lowerCamelCase__				(   a ) ->  List[str]:
   if activation_string in ACTaFN:
      return ACTaFN[activation_string]
   else:
      raise KeyError(f"""function {activation_string} not found in ACT2FN mapping {list(ACTaFN.keys() )}""" )


# For backwards compatibility with: from activations import gelu_python
UpperCAmelCase__						:	Any	     = get_activation('gelu_python')
UpperCAmelCase__						:	Dict	     = get_activation('gelu_new')
UpperCAmelCase__						:	List[Any]	     = get_activation('gelu')
UpperCAmelCase__						:	Dict	     = get_activation('gelu_fast')
UpperCAmelCase__						:	str	     = get_activation('quick_gelu')
UpperCAmelCase__						:	Union[str, Any]	     = get_activation('silu')
UpperCAmelCase__						:	List[Any]	     = get_activation('mish')





UpperCAmelCase__						:	int	     = get_activation('linear')





from collections import OrderedDict
from typing import Any, Mapping, Optional

from ... import PreTrainedTokenizer
from ...configuration_utils import PretrainedConfig
from ...file_utils import TensorType, is_torch_available
from ...onnx import OnnxConfig, OnnxConfigWithPast, OnnxSeqaSeqConfigWithPast
from ...onnx.utils import compute_effective_axis_dimension
from ...utils import logging


UpperCAmelCase__						:	Any	     = logging.get_logger(__name__)

UpperCAmelCase__						:	Optional[Any]	     = {
    'facebook/blenderbot-3B': 'https://huggingface.co/facebook/blenderbot-3B/resolve/main/config.json',
    # See all Blenderbot models at https://huggingface.co/models?filter=blenderbot
}






class UpperCAmelCase  (		SCREAMING_SNAKE_CASE__  ):





   '''simple docstring'''
   __UpperCamelCase						:       Optional[Any]												=       '''blenderbot'''
   __UpperCamelCase						:       Optional[int]												=       ['''past_key_values''']
   __UpperCamelCase						:       Union[str, Any]												=       {'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}


   def __init__(   self	:				Any     ,     lowerCAmelCase_	:				List[str]=8_0_0_8     ,     lowerCAmelCase_	:				Any=1_2_8     ,     lowerCAmelCase_	:				List[str]=2     ,     lowerCAmelCase_	:				Dict=1_0_2_4_0     ,     lowerCAmelCase_	:				Dict=3_2     ,     lowerCAmelCase_	:				Union[str, Any]=2_4     ,     lowerCAmelCase_	:				Union[str, Any]=1_0_2_4_0     ,     lowerCAmelCase_	:				Union[str, Any]=3_2     ,     lowerCAmelCase_	:				Optional[Any]=0.0     ,     lowerCAmelCase_	:				Optional[int]=0.0     ,     lowerCAmelCase_	:				Optional[int]=True     ,     lowerCAmelCase_	:				Optional[Any]=True     ,     lowerCAmelCase_	:				Union[str, Any]="gelu"     ,     lowerCAmelCase_	:				Optional[int]=2_5_6_0     ,     lowerCAmelCase_	:				List[str]=0.1     ,     lowerCAmelCase_	:				Any=0.0     ,     lowerCAmelCase_	:				Union[str, Any]=0.0     ,     lowerCAmelCase_	:				Any=0.02     ,     lowerCAmelCase_	:				List[Any]=1     ,     lowerCAmelCase_	:				List[str]=False     ,     lowerCAmelCase_	:				str=0     ,     lowerCAmelCase_	:				str=1     ,     lowerCAmelCase_	:				List[Any]=2     ,     lowerCAmelCase_	:				List[str]=3     ,     lowerCAmelCase_	:				int=2     ,     **lowerCAmelCase_	:				Tuple     ,     ):

      """simple docstring"""
      _A:    Any						     =			vocab_size
      _A:    Optional[int]						     =			max_position_embeddings
      _A:    int						     =			d_model
      _A:    Optional[int]						     =			encoder_ffn_dim
      _A:    Optional[int]						     =			encoder_layers
      _A:    int						     =			encoder_attention_heads
      _A:    Optional[Any]						     =			decoder_ffn_dim
      _A:    Dict						     =			decoder_layers
      _A:    int						     =			decoder_attention_heads
      _A:    List[str]						     =			dropout
      _A:    Union[str, Any]						     =			attention_dropout
      _A:    Tuple						     =			activation_dropout
      _A:    Dict						     =			activation_function
      _A:    Optional[Any]						     =			init_std
      _A:    Optional[int]						     =			encoder_layerdrop
      _A:    Any						     =			decoder_layerdrop
      _A:    List[str]						     =			use_cache
      _A:    Dict						     =			encoder_layers
      _A:    int						     =			scale_embedding  # scale factor will be sqrt(d_model) if True

      super().__init__(
          pad_token_id=lowerCAmelCase_     ,     bos_token_id=lowerCAmelCase_     ,     eos_token_id=lowerCAmelCase_     ,     is_encoder_decoder=lowerCAmelCase_     ,     decoder_start_token_id=lowerCAmelCase_     ,     encoder_no_repeat_ngram_size=lowerCAmelCase_     ,     forced_eos_token_id=lowerCAmelCase_     ,     **lowerCAmelCase_     ,     )






class UpperCAmelCase  (		SCREAMING_SNAKE_CASE__  ):





   '''simple docstring'''


   @property
   def 					__magic_name__							(   self	:				Any	):

      """simple docstring"""
      if self.task in ["default", "seq2seq-lm"]:
         _A:    Union[str, Any]						     =			OrderedDict(
             [
                 ('''input_ids''', {0: '''batch''', 1: '''encoder_sequence'''}),
                 ('''attention_mask''', {0: '''batch''', 1: '''encoder_sequence'''}),
             ]	)
         if self.use_past:
            _A:    int						     =			{0: '''batch'''}
            _A:    Optional[int]						     =			{0: '''batch''', 1: '''past_decoder_sequence + sequence'''}
         else:
            _A:    List[Any]						     =			{0: '''batch''', 1: '''decoder_sequence'''}
            _A:    Tuple						     =			{0: '''batch''', 1: '''decoder_sequence'''}
         if self.use_past:
            self.fill_with_past_key_values_(lowerCAmelCase_     ,     direction='''inputs'''	)
      elif self.task == "causal-lm":
         _A:    str						     =			OrderedDict(
             [
                 ('''input_ids''', {0: '''batch''', 1: '''encoder_sequence'''}),
                 ('''attention_mask''', {0: '''batch''', 1: '''encoder_sequence'''}),
             ]	)
         if self.use_past:
            _A     ,    _A:    Tuple						     =			self.num_layers
            for i in range(lowerCAmelCase_	):
               _A:    str						     =			{0: '''batch''', 2: '''past_sequence + sequence'''}
               _A:    List[str]						     =			{0: '''batch''', 2: '''past_sequence + sequence'''}
      else:
         _A:    List[Any]						     =			OrderedDict(
             [
                 ('''input_ids''', {0: '''batch''', 1: '''encoder_sequence'''}),
                 ('''attention_mask''', {0: '''batch''', 1: '''encoder_sequence'''}),
                 ('''decoder_input_ids''', {0: '''batch''', 1: '''decoder_sequence'''}),
                 ('''decoder_attention_mask''', {0: '''batch''', 1: '''decoder_sequence'''}),
             ]	)

      return common_inputs


   @property
   # Copied from transformers.models.bart.configuration_bart.BartOnnxConfig.outputs
   def 					__magic_name__							(   self	:				Tuple	):

      """simple docstring"""
      if self.task in ["default", "seq2seq-lm"]:
         _A:    List[str]						     =			super().outputs
      else:
         _A:    Tuple						     =			super(lowerCAmelCase_     ,     self	).outputs
         if self.use_past:
            _A     ,    _A:    Optional[int]						     =			self.num_layers
            for i in range(lowerCAmelCase_	):
               _A:    Union[str, Any]						     =			{0: '''batch''', 2: '''past_sequence + sequence'''}
               _A:    Optional[int]						     =			{0: '''batch''', 2: '''past_sequence + sequence'''}
      return common_outputs


   def 					__magic_name__							(   self	:				Tuple     ,     lowerCAmelCase_	:				PreTrainedTokenizer     ,     lowerCAmelCase_	:				int = -1     ,     lowerCAmelCase_	:				int = -1     ,     lowerCAmelCase_	:				bool = False     ,     lowerCAmelCase_	:				Optional[TensorType] = None     ,     ):

      """simple docstring"""
      _A:    Optional[Any]						     =			self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
          lowerCAmelCase_     ,     lowerCAmelCase_     ,     lowerCAmelCase_     ,     lowerCAmelCase_     ,     lowerCAmelCase_	)
      # Generate decoder inputs
      _A:    int						     =			seq_length if not self.use_past else 1
      _A:    Any						     =			self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
          lowerCAmelCase_     ,     lowerCAmelCase_     ,     lowerCAmelCase_     ,     lowerCAmelCase_     ,     lowerCAmelCase_	)
      _A:    Optional[int]						     =			{F"""decoder_{name}""": tensor for name, tensor in decoder_inputs.items()}
      _A:    Union[str, Any]						     =			dict(**lowerCAmelCase_     ,     **lowerCAmelCase_	)

      if self.use_past:
         if not is_torch_available():
            raise ValueError('''Cannot generate dummy past_keys inputs without PyTorch installed.'''	)
         else:
            import torch
         _A     ,    _A:    str						     =			common_inputs['''input_ids'''].shape
         _A:    Optional[Any]						     =			common_inputs['''decoder_input_ids'''].shape[1]
         _A     ,    _A:    Optional[Any]						     =			self.num_attention_heads
         _A:    List[str]						     =			(
             batch,
             num_encoder_attention_heads,
             encoder_seq_length,
             self._config.hidden_size // num_encoder_attention_heads,
         )
         _A:    Union[str, Any]						     =			decoder_seq_length
         _A:    Tuple						     =			(
             batch,
             num_decoder_attention_heads,
             decoder_past_length,
             self._config.hidden_size // num_decoder_attention_heads,
         )
         _A:    Union[str, Any]						     =			torch.cat(
             [common_inputs['''decoder_attention_mask'''], torch.ones(lowerCAmelCase_     ,     lowerCAmelCase_	)]     ,     dim=1	)
         _A:    List[Any]						     =			[]
         _A     ,    _A:    Union[str, Any]						     =			self.num_layers

         for _ in range(lowerCAmelCase_	):
            common_inputs["past_key_values"].append(
                (
                    torch.zeros(lowerCAmelCase_	),
                    torch.zeros(lowerCAmelCase_	),
                    torch.zeros(lowerCAmelCase_	),
                    torch.zeros(lowerCAmelCase_	),
                )	)
      return common_inputs


   def 					__magic_name__							(   self	:				Union[str, Any]     ,     lowerCAmelCase_	:				PreTrainedTokenizer     ,     lowerCAmelCase_	:				int = -1     ,     lowerCAmelCase_	:				int = -1     ,     lowerCAmelCase_	:				bool = False     ,     lowerCAmelCase_	:				Optional[TensorType] = None     ,     ):

      """simple docstring"""
      _A:    Tuple						     =			self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
          lowerCAmelCase_     ,     lowerCAmelCase_     ,     lowerCAmelCase_     ,     lowerCAmelCase_     ,     lowerCAmelCase_	)

      if self.use_past:
         if not is_torch_available():
            raise ValueError('''Cannot generate dummy past_keys inputs without PyTorch installed.'''	)
         else:
            import torch
         _A     ,    _A:    Optional[int]						     =			common_inputs['''input_ids'''].shape
         _A:    Union[str, Any]						     =			seqlen
         _A     ,    _A:    Tuple						     =			self.num_layers
         _A     ,    _A:    Dict						     =			self.num_attention_heads
         _A:    Tuple						     =			(
             batch,
             num_encoder_attention_heads,
             past_key_values_length,
             self._config.hidden_size // num_encoder_attention_heads,
         )
         _A:    List[Any]						     =			common_inputs['''attention_mask'''].dtype
         _A:    Optional[int]						     =			torch.cat(
             [common_inputs['''attention_mask'''], torch.ones(lowerCAmelCase_     ,     lowerCAmelCase_     ,     dtype=lowerCAmelCase_	)]     ,     dim=1	)
         _A:    Tuple						     =			[
             (torch.zeros(lowerCAmelCase_	), torch.zeros(lowerCAmelCase_	)) for _ in range(lowerCAmelCase_	)
         ]
      return common_inputs


   def 					__magic_name__							(   self	:				Any     ,     lowerCAmelCase_	:				PreTrainedTokenizer     ,     lowerCAmelCase_	:				int = -1     ,     lowerCAmelCase_	:				int = -1     ,     lowerCAmelCase_	:				bool = False     ,     lowerCAmelCase_	:				Optional[TensorType] = None     ,     ):

      """simple docstring"""
      # Copied from OnnxConfig.generate_dummy_inputs
      # Did not use super(OnnxConfigWithPast, self).generate_dummy_inputs for code clarity.
      # If dynamic axis (-1) we forward with a fixed dimension of 2 samples to avoid optimizations made by ONNX
      _A:    Optional[int]						     =			compute_effective_axis_dimension(
          lowerCAmelCase_     ,     fixed_dimension=OnnxConfig.default_fixed_batch     ,     num_token_to_add=0	)

      # If dynamic axis (-1) we forward with a fixed dimension of 8 tokens to avoid optimizations made by ONNX
      _A:    int						     =			tokenizer.num_special_tokens_to_add(lowerCAmelCase_	)
      _A:    Any						     =			compute_effective_axis_dimension(
          lowerCAmelCase_     ,     fixed_dimension=OnnxConfig.default_fixed_sequence     ,     num_token_to_add=lowerCAmelCase_	)

      # Generate dummy inputs according to compute batch and sequence
      _A:    Tuple						     =			[''' '''.join([tokenizer.unk_token]	) * seq_length] * batch_size
      _A:    Any						     =			dict(tokenizer(lowerCAmelCase_     ,     return_tensors=lowerCAmelCase_	)	)
      return common_inputs


   def 					__magic_name__							(   self	:				Dict     ,     lowerCAmelCase_	:				PreTrainedTokenizer     ,     lowerCAmelCase_	:				int = -1     ,     lowerCAmelCase_	:				int = -1     ,     lowerCAmelCase_	:				bool = False     ,     lowerCAmelCase_	:				Optional[TensorType] = None     ,     ):

      """simple docstring"""
      if self.task in ["default", "seq2seq-lm"]:
         _A:    Union[str, Any]						     =			self._generate_dummy_inputs_for_default_and_seqaseq_lm(
             lowerCAmelCase_     ,     batch_size=lowerCAmelCase_     ,     seq_length=lowerCAmelCase_     ,     is_pair=lowerCAmelCase_     ,     framework=lowerCAmelCase_	)

      elif self.task == "causal-lm":
         _A:    Optional[Any]						     =			self._generate_dummy_inputs_for_causal_lm(
             lowerCAmelCase_     ,     batch_size=lowerCAmelCase_     ,     seq_length=lowerCAmelCase_     ,     is_pair=lowerCAmelCase_     ,     framework=lowerCAmelCase_	)
      else:
         _A:    Tuple						     =			self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
             lowerCAmelCase_     ,     batch_size=lowerCAmelCase_     ,     seq_length=lowerCAmelCase_     ,     is_pair=lowerCAmelCase_     ,     framework=lowerCAmelCase_	)

      return common_inputs


   def 					__magic_name__							(   self	:				int     ,     lowerCAmelCase_	:				Tuple     ,     lowerCAmelCase_	:				Any     ,     lowerCAmelCase_	:				str     ,     lowerCAmelCase_	:				List[str]	):

      """simple docstring"""
      if self.task in ["default", "seq2seq-lm"]:
         _A:    int						     =			super()._flatten_past_key_values_(lowerCAmelCase_     ,     lowerCAmelCase_     ,     lowerCAmelCase_     ,     lowerCAmelCase_	)
      else:
         _A:    Optional[int]						     =			super(lowerCAmelCase_     ,     self	)._flatten_past_key_values_(
             lowerCAmelCase_     ,     lowerCAmelCase_     ,     lowerCAmelCase_     ,     lowerCAmelCase_	)


   def 					__magic_name__							(   self	:				Dict     ,     lowerCAmelCase_	:				Mapping[str, Mapping[int, str]]     ,     lowerCAmelCase_	:				str	):

      """simple docstring"""
      if direction not in ["inputs", "outputs"]:
         raise ValueError(F"""direction must either be \"inputs\" or \"outputs\", but {direction} was given"""	)

      _A:    Tuple						     =			'''past_key_values''' if direction == '''inputs''' else '''present'''
      _A     ,    _A:    int						     =			self.num_layers

      _A:    int						     =			'''past_encoder_sequence'''
      _A:    int						     =			'''past_decoder_sequence''' if direction == '''inputs''' else '''past_decoder_sequence + sequence'''

      for i in range(lowerCAmelCase_	):
         _A:    Optional[int]						     =			{0: '''batch''', 2: decoder_sequence}
         _A:    Dict						     =			{0: '''batch''', 2: decoder_sequence}
         _A:    int						     =			{0: '''batch''', 2: encoder_sequence}
         _A:    Optional[int]						     =			{0: '''batch''', 2: encoder_sequence}



