


from typing import Optional, Tuple, Union

import tensorflow as tf

from ...activations_tf import ACTaFN
from ...file_utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward
from ...modeling_tf_outputs import (
    TFBaseModelOutputWithNoAttention,
    TFBaseModelOutputWithPoolingAndNoAttention,
    TFSequenceClassifierOutput,
)
from ...modeling_tf_utils import TFPreTrainedModel, TFSequenceClassificationLoss, keras_serializable, unpack_inputs
from ...tf_utils import shape_list
from ...utils import logging
from .configuration_regnet import RegNetConfig


A			:						Dict        =  logging.get_logger(__name__)

# General docstring
A			:						Tuple        =  'RegNetConfig'

# Base docstring
A			:						str        =  'facebook/regnet-y-040'
A			:						int        =  [1, 1_0_8_8, 7, 7]

# Image classification docstring
A			:						int        =  'facebook/regnet-y-040'
A			:						int        =  'tabby, tabby cat'

A			:						List[str]        =  [
    'facebook/regnet-y-040',
    # See all regnet models at https://huggingface.co/models?filter=regnet
]



class 				A       (			tf.keras.layers.Layer				):
					'''simple docstring'''






					def __init__(self       :		str ,   _UpperCAmelCase       :		int ,   _UpperCAmelCase       :		int = 3 ,   _UpperCAmelCase       :		int = 1 ,   _UpperCAmelCase       :		int = 1 ,   _UpperCAmelCase       :		Optional[str] = "relu" ,   **_UpperCAmelCase       :		str ,   )		->  Optional[Any]:




							"""simple docstring"""


							super().__init__(**_UpperCAmelCase						)
							# The padding and conv has been verified in
							# https://colab.research.google.com/gist/sayakpaul/854bc10eeaf21c9ee2119e0b9f3841a7/scratchpad.ipynb
							lowercase__	     =						tf.keras.layers.ZeroPaddingaD(padding=kernel_size // 2						)
							lowercase__	     =						tf.keras.layers.ConvaD(
							    filters=_UpperCAmelCase ,   kernel_size=_UpperCAmelCase ,   strides=_UpperCAmelCase ,   padding="""VALID""" ,   groups=_UpperCAmelCase ,   use_bias=_UpperCAmelCase ,   name="""convolution""" ,   )
							lowercase__	     =						tf.keras.layers.BatchNormalization(epsilon=1E-5 ,   momentum=0.9 ,   name="""normalization"""						)
							lowercase__	     =						ACTaFN[activation] if activation is not None else tf.identity


					def     lowerCamelCase__	(self       :		Tuple ,   _UpperCAmelCase       :		Optional[Any]						)		->  str:




							"""simple docstring"""


							lowercase__	     =						self.convolution(self.padding(_UpperCAmelCase						)						)
							lowercase__	     =						self.normalization(_UpperCAmelCase						)
							lowercase__	     =						self.activation(_UpperCAmelCase						)
							return hidden_state






class 				A       (			tf.keras.layers.Layer				):
					'''simple docstring'''






					def __init__(self       :		Optional[Any] ,   _UpperCAmelCase       :		RegNetConfig ,   **_UpperCAmelCase       :		Dict						)		->  Optional[Any]:




							"""simple docstring"""


							super().__init__(**_UpperCAmelCase						)
							lowercase__	     =						config.num_channels
							lowercase__	     =						TFRegNetConvLayer(
							    out_channels=config.embedding_size ,   kernel_size=3 ,   stride=2 ,   activation=config.hidden_act ,   name="""embedder""" ,   )


					def     lowerCamelCase__	(self       :		List[str] ,   _UpperCAmelCase       :		str						)		->  Optional[int]:




							"""simple docstring"""


							lowercase__	     =						shape_list(_UpperCAmelCase						)[1]
							if tf.executing_eagerly() and num_channels != self.num_channels:
									raise ValueError(
									    """Make sure that the channel dimension of the pixel values match with the one set in the configuration."""						)

							# When running on CPU, `tf.keras.layers.Conv2D` doesn't support `NCHW` format.
							# So change the input format from `NCHW` to `NHWC`.
							# shape = (batch_size, in_height, in_width, in_channels=num_channels)
							lowercase__	     =						tf.transpose(_UpperCAmelCase ,   perm=(0, 2, 3, 1)						)
							lowercase__	     =						self.embedder(_UpperCAmelCase						)
							return hidden_state






class 				A       (			tf.keras.layers.Layer				):
					'''simple docstring'''






					def __init__(self       :		int ,   _UpperCAmelCase       :		int ,   _UpperCAmelCase       :		int = 2 ,   **_UpperCAmelCase       :		Optional[int]						)		->  Union[str, Any]:




							"""simple docstring"""


							super().__init__(**_UpperCAmelCase						)
							lowercase__	     =						tf.keras.layers.ConvaD(
							    filters=_UpperCAmelCase ,   kernel_size=1 ,   strides=_UpperCAmelCase ,   use_bias=_UpperCAmelCase ,   name="""convolution"""						)
							lowercase__	     =						tf.keras.layers.BatchNormalization(epsilon=1E-5 ,   momentum=0.9 ,   name="""normalization"""						)


					def     lowerCamelCase__	(self       :		Optional[int] ,   _UpperCAmelCase       :		tf.Tensor ,   _UpperCAmelCase       :		bool = False						)		->  tf.Tensor:




							"""simple docstring"""


							return self.normalization(self.convolution(_UpperCAmelCase						) ,   training=_UpperCAmelCase						)






class 				A       (			tf.keras.layers.Layer				):
					'''simple docstring'''






					def __init__(self       :		Tuple ,   _UpperCAmelCase       :		int ,   _UpperCAmelCase       :		int ,   **_UpperCAmelCase       :		List[Any]						)		->  List[Any]:




							"""simple docstring"""


							super().__init__(**_UpperCAmelCase						)
							lowercase__	     =						tf.keras.layers.GlobalAveragePoolingaD(keepdims=_UpperCAmelCase ,   name="""pooler"""						)
							lowercase__	     =						[
							    tf.keras.layers.ConvaD(filters=_UpperCAmelCase ,   kernel_size=1 ,   activation="""relu""" ,   name="""attention.0"""						),
							    tf.keras.layers.ConvaD(filters=_UpperCAmelCase ,   kernel_size=1 ,   activation="""sigmoid""" ,   name="""attention.2"""						),
							]


					def     lowerCamelCase__	(self       :		Optional[int] ,   _UpperCAmelCase       :		int						)		->  Optional[Any]:




							"""simple docstring"""


							lowercase__	     =						self.pooler(_UpperCAmelCase						)
							for layer_module in self.attention:
									lowercase__	     =						layer_module(_UpperCAmelCase						)
							lowercase__	     =						hidden_state * pooled
							return hidden_state






class 				A       (			tf.keras.layers.Layer				):
					'''simple docstring'''






					def __init__(self       :		str ,   _UpperCAmelCase       :		RegNetConfig ,   _UpperCAmelCase       :		int ,   _UpperCAmelCase       :		int ,   _UpperCAmelCase       :		int = 1 ,   **_UpperCAmelCase       :		int						)		->  Any:




							"""simple docstring"""


							super().__init__(**_UpperCAmelCase						)
							lowercase__	     =						in_channels != out_channels or stride != 1
							lowercase__	     =						max(1 ,   out_channels // config.groups_width						)
							lowercase__	     =						(
							    TFRegNetShortCut(_UpperCAmelCase ,   stride=_UpperCAmelCase ,   name="""shortcut"""						)
							    if should_apply_shortcut
							    else tf.keras.layers.Activation("""linear""" ,   name="""shortcut"""						)
							)
							# `self.layers` instead of `self.layer` because that is a reserved argument.
							lowercase__	     =						[
							    TFRegNetConvLayer(_UpperCAmelCase ,   kernel_size=1 ,   activation=config.hidden_act ,   name="""layer.0"""						),
							    TFRegNetConvLayer(
							        _UpperCAmelCase ,   stride=_UpperCAmelCase ,   groups=_UpperCAmelCase ,   activation=config.hidden_act ,   name="""layer.1"""						),
							    TFRegNetConvLayer(_UpperCAmelCase ,   kernel_size=1 ,   activation=_UpperCAmelCase ,   name="""layer.2"""						),
							]
							lowercase__	     =						ACTaFN[config.hidden_act]


					def     lowerCamelCase__	(self       :		List[Any] ,   _UpperCAmelCase       :		str						)		->  Optional[Any]:




							"""simple docstring"""


							lowercase__	     =						hidden_state
							for layer_module in self.layers:
									lowercase__	     =						layer_module(_UpperCAmelCase						)
							lowercase__	     =						self.shortcut(_UpperCAmelCase						)
							hidden_state += residual
							lowercase__	     =						self.activation(_UpperCAmelCase						)
							return hidden_state






class 				A       (			tf.keras.layers.Layer				):
					'''simple docstring'''






					def __init__(self       :		List[Any] ,   _UpperCAmelCase       :		RegNetConfig ,   _UpperCAmelCase       :		int ,   _UpperCAmelCase       :		int ,   _UpperCAmelCase       :		int = 1 ,   **_UpperCAmelCase       :		List[str]						)		->  Union[str, Any]:




							"""simple docstring"""


							super().__init__(**_UpperCAmelCase						)
							lowercase__	     =						in_channels != out_channels or stride != 1
							lowercase__	     =						max(1 ,   out_channels // config.groups_width						)
							lowercase__	     =						(
							    TFRegNetShortCut(_UpperCAmelCase ,   stride=_UpperCAmelCase ,   name="""shortcut"""						)
							    if should_apply_shortcut
							    else tf.keras.layers.Activation("""linear""" ,   name="""shortcut"""						)
							)
							lowercase__	     =						[
							    TFRegNetConvLayer(_UpperCAmelCase ,   kernel_size=1 ,   activation=config.hidden_act ,   name="""layer.0"""						),
							    TFRegNetConvLayer(
							        _UpperCAmelCase ,   stride=_UpperCAmelCase ,   groups=_UpperCAmelCase ,   activation=config.hidden_act ,   name="""layer.1"""						),
							    TFRegNetSELayer(_UpperCAmelCase ,   reduced_channels=int(round(in_channels / 4						)						) ,   name="""layer.2"""						),
							    TFRegNetConvLayer(_UpperCAmelCase ,   kernel_size=1 ,   activation=_UpperCAmelCase ,   name="""layer.3"""						),
							]
							lowercase__	     =						ACTaFN[config.hidden_act]


					def     lowerCamelCase__	(self       :		List[Any] ,   _UpperCAmelCase       :		Union[str, Any]						)		->  Optional[Any]:




							"""simple docstring"""


							lowercase__	     =						hidden_state
							for layer_module in self.layers:
									lowercase__	     =						layer_module(_UpperCAmelCase						)
							lowercase__	     =						self.shortcut(_UpperCAmelCase						)
							hidden_state += residual
							lowercase__	     =						self.activation(_UpperCAmelCase						)
							return hidden_state






class 				A       (			tf.keras.layers.Layer				):
					'''simple docstring'''






					def __init__(self       :		List[Any] ,   _UpperCAmelCase       :		RegNetConfig ,   _UpperCAmelCase       :		int ,   _UpperCAmelCase       :		int ,   _UpperCAmelCase       :		int = 2 ,   _UpperCAmelCase       :		int = 2 ,   **_UpperCAmelCase       :		Tuple						)		->  List[str]:




							"""simple docstring"""


							super().__init__(**_UpperCAmelCase						)

							lowercase__	     =						TFRegNetXLayer if config.layer_type == """x""" else TFRegNetYLayer
							lowercase__	     =						[
							    # downsampling is done in the first layer with stride of 2
							    layer(_UpperCAmelCase ,   _UpperCAmelCase ,   _UpperCAmelCase ,   stride=_UpperCAmelCase ,   name="""layers.0"""						),
							    *[layer(_UpperCAmelCase ,   _UpperCAmelCase ,   _UpperCAmelCase ,   name=f'''layers.{i+1}'''						) for i in range(depth - 1						)],
							]


					def     lowerCamelCase__	(self       :		List[str] ,   _UpperCAmelCase       :		Optional[int]						)		->  List[str]:




							"""simple docstring"""


							for layer_module in self.layers:
									lowercase__	     =						layer_module(_UpperCAmelCase						)
							return hidden_state






class 				A       (			tf.keras.layers.Layer				):
					'''simple docstring'''






					def __init__(self       :		Tuple ,   _UpperCAmelCase       :		RegNetConfig ,   **_UpperCAmelCase       :		str						)		->  Any:




							"""simple docstring"""


							super().__init__(**_UpperCAmelCase						)
							lowercase__	     =						[]
							# based on `downsample_in_first_stage`, the first layer of the first stage may or may not downsample the input
							self.stages.append(
							    TFRegNetStage(
							        _UpperCAmelCase ,   config.embedding_size ,   config.hidden_sizes[0] ,   stride=2 if config.downsample_in_first_stage else 1 ,   depth=config.depths[0] ,   name="""stages.0""" ,   )						)
							lowercase__	     =						zip(config.hidden_sizes ,   config.hidden_sizes[1:]						)
							for i, ((in_channels, out_channels), depth) in enumerate(zip(_UpperCAmelCase ,   config.depths[1:]						)						):
									self.stages.append(TFRegNetStage(_UpperCAmelCase ,   _UpperCAmelCase ,   _UpperCAmelCase ,   depth=_UpperCAmelCase ,   name=f'''stages.{i+1}'''						)						)


					def     lowerCamelCase__	(self       :		Dict ,   _UpperCAmelCase       :		tf.Tensor ,   _UpperCAmelCase       :		bool = False ,   _UpperCAmelCase       :		bool = True						)		->  TFBaseModelOutputWithNoAttention:




							"""simple docstring"""


							lowercase__	     =						() if output_hidden_states else None

							for stage_module in self.stages:
									if output_hidden_states:
											lowercase__	     =						hidden_states + (hidden_state,)

									lowercase__	     =						stage_module(_UpperCAmelCase						)

							if output_hidden_states:
									lowercase__	     =						hidden_states + (hidden_state,)

							if not return_dict:
									return tuple(v for v in [hidden_state, hidden_states] if v is not None						)

							return TFBaseModelOutputWithNoAttention(last_hidden_state=_UpperCAmelCase ,   hidden_states=_UpperCAmelCase						)






@keras_serializable
class 				A       (			tf.keras.layers.Layer				):
					'''simple docstring'''






					A__     =					RegNetConfig

					def __init__(self       :		Union[str, Any] ,   _UpperCAmelCase       :		Any ,   **_UpperCAmelCase       :		Any						)		->  int:




							"""simple docstring"""


							super().__init__(**_UpperCAmelCase						)
							lowercase__	     =						config
							lowercase__	     =						TFRegNetEmbeddings(_UpperCAmelCase ,   name="""embedder"""						)
							lowercase__	     =						TFRegNetEncoder(_UpperCAmelCase ,   name="""encoder"""						)
							lowercase__	     =						tf.keras.layers.GlobalAveragePoolingaD(keepdims=_UpperCAmelCase ,   name="""pooler"""						)


					@unpack_inputs
					def     lowerCamelCase__	(self       :		Union[str, Any] ,   _UpperCAmelCase       :		tf.Tensor ,   _UpperCAmelCase       :		Optional[bool] = None ,   _UpperCAmelCase       :		Optional[bool] = None ,   _UpperCAmelCase       :		bool = False ,   )		->  TFBaseModelOutputWithPoolingAndNoAttention:




							"""simple docstring"""


							lowercase__	     =						(
							    output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
							)
							lowercase__	     =						return_dict if return_dict is not None else self.config.use_return_dict

							lowercase__	     =						self.embedder(_UpperCAmelCase ,   training=_UpperCAmelCase						)

							lowercase__	     =						self.encoder(
							    _UpperCAmelCase ,   output_hidden_states=_UpperCAmelCase ,   return_dict=_UpperCAmelCase ,   training=_UpperCAmelCase						)

							lowercase__	     =						encoder_outputs[0]
							lowercase__	     =						self.pooler(_UpperCAmelCase						)

							# Change to NCHW output format have uniformity in the modules
							lowercase__	     =						tf.transpose(_UpperCAmelCase ,   perm=(0, 3, 1, 2)						)
							lowercase__	     =						tf.transpose(_UpperCAmelCase ,   perm=(0, 3, 1, 2)						)

							# Change the other hidden state outputs to NCHW as well
							if output_hidden_states:
									lowercase__	     =						tuple([tf.transpose(_UpperCAmelCase ,   perm=(0, 3, 1, 2)						) for h in encoder_outputs[1]]						)

							if not return_dict:
									return (last_hidden_state, pooled_output) + encoder_outputs[1:]

							return TFBaseModelOutputWithPoolingAndNoAttention(
							    last_hidden_state=_UpperCAmelCase ,   pooler_output=_UpperCAmelCase ,   hidden_states=hidden_states if output_hidden_states else encoder_outputs.hidden_states ,   )






class 				A       (			UpperCAmelCase__				):
					'''simple docstring'''






					A__     =					RegNetConfig
					A__     =					'''regnet'''
					A__     =					'''pixel_values'''

					@property
					def     lowerCamelCase__	(self       :		Any						)		->  Optional[Any]:




							"""simple docstring"""


							return {"pixel_values": tf.TensorSpec(shape=(None, self.config.num_channels, 224, 224) ,   dtype=tf.floataa						)}






A			:						Dict        =  r'\n    Parameters:\n    This model is a Tensorflow\n    [tf.keras.layers.Layer](https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer) sub-class. Use it as a\n    regular Tensorflow Module and refer to the Tensorflow documentation for all matter related to general usage and\n    behavior.\n        config ([`RegNetConfig`]): Model configuration class with all the parameters of the model.\n            Initializing with a config file does not load the weights associated with the model, only the\n            configuration. Check out the [`~TFPreTrainedModel.from_pretrained`] method to load the model weights.\n'

A			:						List[str]        =  r'\n    Args:\n        pixel_values (`tf.Tensor` of shape `(batch_size, num_channels, height, width)`):\n            Pixel values. Pixel values can be obtained using [`AutoImageProcessor`]. See\n            [`ConveNextImageProcessor.__call__`] for details.\n        output_hidden_states (`bool`, *optional*):\n            Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for\n            more detail.\n        return_dict (`bool`, *optional*):\n            Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.\n'



@add_start_docstrings(
    '''The bare RegNet model outputting raw features without any specific head on top.'''					,    UpperCAmelCase__					,    )
class 				A       (			UpperCAmelCase__				):
					'''simple docstring'''






					def __init__(self       :		str ,   _UpperCAmelCase       :		RegNetConfig ,   *_UpperCAmelCase       :		Tuple ,   **_UpperCAmelCase       :		Optional[int]						)		->  int:




							"""simple docstring"""


							super().__init__(_UpperCAmelCase ,   *_UpperCAmelCase ,   **_UpperCAmelCase						)
							lowercase__	     =						TFRegNetMainLayer(_UpperCAmelCase ,   name="""regnet"""						)


					@unpack_inputs
					@add_start_docstrings_to_model_forward(_UpperCAmelCase						)
					@add_code_sample_docstrings(
					    checkpoint=_CHECKPOINT_FOR_DOC ,   output_type=_UpperCAmelCase ,   config_class=_CONFIG_FOR_DOC ,   modality="""vision""" ,   expected_output=_EXPECTED_OUTPUT_SHAPE ,   )
					def     lowerCamelCase__	(self       :		int ,   _UpperCAmelCase       :		tf.Tensor ,   _UpperCAmelCase       :		Optional[bool] = None ,   _UpperCAmelCase       :		Optional[bool] = None ,   _UpperCAmelCase       :		str=False ,   )		->  Union[TFBaseModelOutputWithPoolingAndNoAttention, Tuple[tf.Tensor]]:




							"""simple docstring"""


							lowercase__	     =						(
							    output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
							)
							lowercase__	     =						return_dict if return_dict is not None else self.config.use_return_dict

							lowercase__	     =						self.regnet(
							    pixel_values=_UpperCAmelCase ,   output_hidden_states=_UpperCAmelCase ,   return_dict=_UpperCAmelCase ,   training=_UpperCAmelCase ,   )
							if not return_dict:
									return (outputs[0],) + outputs[1:]

							return TFBaseModelOutputWithPoolingAndNoAttention(
							    last_hidden_state=outputs.last_hidden_state ,   pooler_output=outputs.pooler_output ,   hidden_states=outputs.hidden_states ,   )






@add_start_docstrings(
    '''
    RegNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
    ImageNet.
    '''					,    UpperCAmelCase__					,    )
class 				A       (			UpperCAmelCase__					,    UpperCAmelCase__				):
					'''simple docstring'''






					def __init__(self       :		int ,   _UpperCAmelCase       :		RegNetConfig ,   *_UpperCAmelCase       :		Optional[int] ,   **_UpperCAmelCase       :		str						)		->  Union[str, Any]:




							"""simple docstring"""


							super().__init__(_UpperCAmelCase ,   *_UpperCAmelCase ,   **_UpperCAmelCase						)
							lowercase__	     =						config.num_labels
							lowercase__	     =						TFRegNetMainLayer(_UpperCAmelCase ,   name="""regnet"""						)
							# classification head
							lowercase__	     =						[
							    tf.keras.layers.Flatten(),
							    tf.keras.layers.Dense(config.num_labels ,   name="""classifier.1"""						) if config.num_labels > 0 else tf.identity,
							]


					@unpack_inputs
					@add_start_docstrings_to_model_forward(_UpperCAmelCase						)
					@add_code_sample_docstrings(
					    checkpoint=_IMAGE_CLASS_CHECKPOINT ,   output_type=_UpperCAmelCase ,   config_class=_CONFIG_FOR_DOC ,   expected_output=_IMAGE_CLASS_EXPECTED_OUTPUT ,   )
					def     lowerCamelCase__	(self       :		Any ,   _UpperCAmelCase       :		tf.Tensor = None ,   _UpperCAmelCase       :		tf.Tensor = None ,   _UpperCAmelCase       :		bool = None ,   _UpperCAmelCase       :		bool = None ,   _UpperCAmelCase       :		int=False ,   )		->  Union[TFSequenceClassifierOutput, Tuple[tf.Tensor]]:




							"""simple docstring"""


							lowercase__	     =						(
							    output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
							)
							lowercase__	     =						return_dict if return_dict is not None else self.config.use_return_dict

							lowercase__	     =						self.regnet(
							    _UpperCAmelCase ,   output_hidden_states=_UpperCAmelCase ,   return_dict=_UpperCAmelCase ,   training=_UpperCAmelCase						)

							lowercase__	     =						outputs.pooler_output if return_dict else outputs[1]

							lowercase__	     =						self.classifier[0](_UpperCAmelCase						)
							lowercase__	     =						self.classifier[1](_UpperCAmelCase						)

							lowercase__	     =						None if labels is None else self.hf_compute_loss(labels=_UpperCAmelCase ,   logits=_UpperCAmelCase						)

							if not return_dict:
									lowercase__	     =						(logits,) + outputs[2:]
									return ((loss,) + output) if loss is not None else output

							return TFSequenceClassifierOutput(loss=_UpperCAmelCase ,   logits=_UpperCAmelCase ,   hidden_states=outputs.hidden_states						)





from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


A			:						List[str]        =  logging.get_logger(__name__)

A			:						Tuple        =  {
    'kssteven/ibert-roberta-base': 'https://huggingface.co/kssteven/ibert-roberta-base/resolve/main/config.json',
    'kssteven/ibert-roberta-large': 'https://huggingface.co/kssteven/ibert-roberta-large/resolve/main/config.json',
    'kssteven/ibert-roberta-large-mnli': (
        'https://huggingface.co/kssteven/ibert-roberta-large-mnli/resolve/main/config.json'
    ),
}



class 				A       (			UpperCAmelCase__				):
					'''simple docstring'''






					A__     =					'''ibert'''

					def __init__(self       :		int ,   _UpperCAmelCase       :		Union[str, Any]=3_0522 ,   _UpperCAmelCase       :		Any=768 ,   _UpperCAmelCase       :		Optional[Any]=12 ,   _UpperCAmelCase       :		Union[str, Any]=12 ,   _UpperCAmelCase       :		List[Any]=3072 ,   _UpperCAmelCase       :		List[Any]="gelu" ,   _UpperCAmelCase       :		List[str]=0.1 ,   _UpperCAmelCase       :		Union[str, Any]=0.1 ,   _UpperCAmelCase       :		Optional[int]=512 ,   _UpperCAmelCase       :		str=2 ,   _UpperCAmelCase       :		Union[str, Any]=0.02 ,   _UpperCAmelCase       :		Dict=1E-1_2 ,   _UpperCAmelCase       :		int=1 ,   _UpperCAmelCase       :		str=0 ,   _UpperCAmelCase       :		Tuple=2 ,   _UpperCAmelCase       :		int="absolute" ,   _UpperCAmelCase       :		Any=False ,   _UpperCAmelCase       :		List[Any]="none" ,   **_UpperCAmelCase       :		List[Any] ,   )		->  Any:




							"""simple docstring"""


							super().__init__(pad_token_id=_UpperCAmelCase ,   bos_token_id=_UpperCAmelCase ,   eos_token_id=_UpperCAmelCase ,   **_UpperCAmelCase						)

							lowercase__	     =						vocab_size
							lowercase__	     =						hidden_size
							lowercase__	     =						num_hidden_layers
							lowercase__	     =						num_attention_heads
							lowercase__	     =						hidden_act
							lowercase__	     =						intermediate_size
							lowercase__	     =						hidden_dropout_prob
							lowercase__	     =						attention_probs_dropout_prob
							lowercase__	     =						max_position_embeddings
							lowercase__	     =						type_vocab_size
							lowercase__	     =						initializer_range
							lowercase__	     =						layer_norm_eps
							lowercase__	     =						position_embedding_type
							lowercase__	     =						quant_mode
							lowercase__	     =						force_dequant






class 				A       (			UpperCAmelCase__				):
					'''simple docstring'''






					@property
					def     lowerCamelCase__	(self       :		Dict						)		->  Mapping[str, Mapping[int, str]]:




							"""simple docstring"""


							if self.task == "multiple-choice":
									lowercase__	     =						{0: """batch""", 1: """choice""", 2: """sequence"""}
							else:
									lowercase__	     =						{0: """batch""", 1: """sequence"""}
							return OrderedDict(
							    [
							        ("""input_ids""", dynamic_axis),
							        ("""attention_mask""", dynamic_axis),
							    ]						)

