



"""simple docstring"""







from collections import OrderedDict
from typing import Mapping

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


UpperCAmelCase:   int       			=							logging.get_logger(__name__)

UpperCAmelCase:   Any       			=							{
    """google/mobilebert-uncased""": """https://huggingface.co/google/mobilebert-uncased/resolve/main/config.json"""
}





class    UpperCamelCase     (			snake_case    ):




	"""simple docstring"""
	SCREAMING_SNAKE_CASE_				:    str		    =   MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP
	SCREAMING_SNAKE_CASE_				:    List[Any]		    =   "mobilebert"






	def __init__(			self							,UpperCAmelCase_=3_05_22							,UpperCAmelCase_=5_12							,UpperCAmelCase_=24							,UpperCAmelCase_=4							,UpperCAmelCase_=5_12							,UpperCAmelCase_="relu"							,UpperCAmelCase_=0.0							,UpperCAmelCase_=0.1							,UpperCAmelCase_=5_12							,UpperCAmelCase_=2							,UpperCAmelCase_=0.02							,UpperCAmelCase_=1E-12							,UpperCAmelCase_=0							,UpperCAmelCase_=1_28							,UpperCAmelCase_=True							,UpperCAmelCase_=True							,UpperCAmelCase_=1_28							,UpperCAmelCase_=False							,UpperCAmelCase_=True							,UpperCAmelCase_=4							,UpperCAmelCase_="no_norm"							,UpperCAmelCase_=True							,UpperCAmelCase_=None							,**UpperCAmelCase_							,):
			super().__init__(pad_token_id=UpperCAmelCase_							,**UpperCAmelCase_					)

			_lowercase							:      List[Any]			=					vocab_size
			_lowercase							:      str			=					hidden_size
			_lowercase							:      str			=					num_hidden_layers
			_lowercase							:      Dict			=					num_attention_heads
			_lowercase							:      Tuple			=					hidden_act
			_lowercase							:      int			=					intermediate_size
			_lowercase							:      Dict			=					hidden_dropout_prob
			_lowercase							:      Dict			=					attention_probs_dropout_prob
			_lowercase							:      List[Any]			=					max_position_embeddings
			_lowercase							:      Union[str, Any]			=					type_vocab_size
			_lowercase							:      int			=					initializer_range
			_lowercase							:      Optional[int]			=					layer_norm_eps
			_lowercase							:      str			=					embedding_size
			_lowercase							:      List[str]			=					trigram_input
			_lowercase							:      Dict			=					use_bottleneck
			_lowercase							:      Optional[Any]			=					intra_bottleneck_size
			_lowercase							:      Optional[Any]			=					use_bottleneck_attention
			_lowercase							:      Optional[Any]			=					key_query_shared_bottleneck
			_lowercase							:      int			=					num_feedforward_networks
			_lowercase							:      str			=					normalization_type
			_lowercase							:      Union[str, Any]			=					classifier_activation

			if self.use_bottleneck:
					_lowercase							:      List[Any]			=					intra_bottleneck_size
			else:
					_lowercase							:      int			=					hidden_size

			_lowercase							:      str			=					classifier_dropout







class    UpperCamelCase     (			snake_case    ):




	"""simple docstring"""






	@property
	def 					lowerCamelCase__ (			self					):
			if self.task == "multiple-choice":
					_lowercase							:      Optional[Any]			=					{0: """batch""", 1: """choice""", 2: """sequence"""}
			else:
					_lowercase							:      Union[str, Any]			=					{0: """batch""", 1: """sequence"""}
			return OrderedDict(
			    [
			        ("""input_ids""", dynamic_axis),
			        ("""attention_mask""", dynamic_axis),
			        ("""token_type_ids""", dynamic_axis),
			    ]					)










'''simple docstring'''



import torch

from transformers import PreTrainedModel

from .custom_configuration import CustomConfig, NoSuperInitConfig






class 							__lowercase				(					lowerCAmelCase__  ):







	'''simple docstring'''

	a			: Union[str, Any]      =				CustomConfig


	def __init__(self   ,_lowerCamelCase       )							->							Tuple:







				'''simple docstring'''





				super().__init__(_lowerCamelCase       )
				__lowercase   =							torch.nn.Linear(config.hidden_size   ,config.hidden_size       )


	def   _UpperCAmelCase   (self   ,_lowerCamelCase       )							->							List[str]:







				'''simple docstring'''





				return self.linear(_lowerCamelCase       )


	def   _UpperCAmelCase   (self   ,_lowerCamelCase       )							->							List[Any]:







				'''simple docstring'''





				pass






class 							__lowercase				(					lowerCAmelCase__  ):







	'''simple docstring'''

	a			: Dict      =				NoSuperInitConfig


	def __init__(self   ,_lowerCamelCase       )							->							str:







				'''simple docstring'''





				super().__init__(_lowerCamelCase       )
				__lowercase   =							torch.nn.Linear(config.attribute   ,config.attribute       )


	def   _UpperCAmelCase   (self   ,_lowerCamelCase       )							->							List[str]:







				'''simple docstring'''





				return self.linear(_lowerCamelCase       )


	def   _UpperCAmelCase   (self   ,_lowerCamelCase       )							->							Tuple:







				'''simple docstring'''





				pass





