


"""simple docstring"""



from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


__snake_case         =					logging.get_logger(__name__)

__snake_case         =					{
    """google/bit-50""": """https://huggingface.co/google/bit-50/resolve/main/config.json""",
}







class _lowerCAmelCase       (   snake_case_					,							snake_case_			):
   __UpperCAmelCase				: Any													=						'''bit'''
   __UpperCAmelCase				: Tuple													=						['''preactivation''', '''bottleneck''']
   __UpperCAmelCase				: List[Any]													=						['''SAME''', '''VALID''']







   def __init__(			self		,			UpperCamelCase__=3		,			UpperCamelCase__=64		,			UpperCamelCase__=[256, 512, 1024, 2048]		,			UpperCamelCase__=[3, 4, 6, 3]		,			UpperCamelCase__="preactivation"		,			UpperCamelCase__="relu"		,			UpperCamelCase__=None		,			UpperCamelCase__=32		,			UpperCamelCase__=0.0		,			UpperCamelCase__=False		,			UpperCamelCase__=32		,			UpperCamelCase__=1		,			UpperCamelCase__=None		,			UpperCamelCase__=None		,			**UpperCamelCase__		,			)			->	Optional[Any]:

       '''simple docstring'''




       super().__init__(**UpperCamelCase__		)
       if layer_type not in self.layer_types:
           raise ValueError(F'layer_type={layer_type} is not one of {",".join(self.layer_types		)}'		)
       if global_padding is not None:
           if global_padding.upper() in self.supported_padding:
               snake_case					:   int         =					global_padding.upper()
           else:
               raise ValueError(F'Padding strategy {global_padding} not supported'		)
       snake_case					:   Dict         =					num_channels
       snake_case					:   List[Any]         =					embedding_size
       snake_case					:   List[Any]         =					hidden_sizes
       snake_case					:   Tuple         =					depths
       snake_case					:   Optional[Any]         =					layer_type
       snake_case					:   Any         =					hidden_act
       snake_case					:   Dict         =					global_padding
       snake_case					:   Tuple         =					num_groups
       snake_case					:   str         =					drop_path_rate
       snake_case					:   int         =					embedding_dynamic_padding
       snake_case					:   Union[str, Any]         =					output_stride
       snake_case					:   List[str]         =					width_factor

       snake_case					:   Tuple         =					["stem"] + [F'stage{idx}' for idx in range(1		,			len(UpperCamelCase__		) + 1		)]
       snake_case      ,snake_case					:   Any         =					get_aligned_output_features_output_indices(
           out_features=UpperCamelCase__		,			out_indices=UpperCamelCase__		,			stage_names=self.stage_names		)









"""simple docstring"""



from collections import OrderedDict
from typing import Mapping

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


__snake_case         =					logging.get_logger(__name__)

__snake_case         =					{
    """google/bigbird-roberta-base""": """https://huggingface.co/google/bigbird-roberta-base/resolve/main/config.json""",
    """google/bigbird-roberta-large""": """https://huggingface.co/google/bigbird-roberta-large/resolve/main/config.json""",
    """google/bigbird-base-trivia-itc""": """https://huggingface.co/google/bigbird-base-trivia-itc/resolve/main/config.json""",
    # See all BigBird models at https://huggingface.co/models?filter=big_bird
}







class _lowerCAmelCase       (   snake_case_			):
   __UpperCAmelCase				: Optional[Any]													=						'''big_bird'''







   def __init__(			self		,			UpperCamelCase__=5_0358		,			UpperCamelCase__=768		,			UpperCamelCase__=12		,			UpperCamelCase__=12		,			UpperCamelCase__=3072		,			UpperCamelCase__="gelu_new"		,			UpperCamelCase__=0.1		,			UpperCamelCase__=0.1		,			UpperCamelCase__=4096		,			UpperCamelCase__=2		,			UpperCamelCase__=0.02		,			UpperCamelCase__=1e-12		,			UpperCamelCase__=True		,			UpperCamelCase__=0		,			UpperCamelCase__=1		,			UpperCamelCase__=2		,			UpperCamelCase__=66		,			UpperCamelCase__="block_sparse"		,			UpperCamelCase__=True		,			UpperCamelCase__=False		,			UpperCamelCase__=64		,			UpperCamelCase__=3		,			UpperCamelCase__=None		,			**UpperCamelCase__		,			)			->	Tuple:

       '''simple docstring'''




       super().__init__(
           pad_token_id=UpperCamelCase__		,			bos_token_id=UpperCamelCase__		,			eos_token_id=UpperCamelCase__		,			sep_token_id=UpperCamelCase__		,			**UpperCamelCase__		,			)

       snake_case					:   Union[str, Any]         =					vocab_size
       snake_case					:   List[Any]         =					max_position_embeddings
       snake_case					:   int         =					hidden_size
       snake_case					:   str         =					num_hidden_layers
       snake_case					:   Any         =					num_attention_heads
       snake_case					:   int         =					intermediate_size
       snake_case					:   Union[str, Any]         =					hidden_act
       snake_case					:   Optional[Any]         =					hidden_dropout_prob
       snake_case					:   List[Any]         =					attention_probs_dropout_prob
       snake_case					:   int         =					initializer_range
       snake_case					:   List[str]         =					type_vocab_size
       snake_case					:   Optional[Any]         =					layer_norm_eps
       snake_case					:   Optional[Any]         =					use_cache

       snake_case					:   List[Any]         =					rescale_embeddings
       snake_case					:   Any         =					attention_type
       snake_case					:   List[Any]         =					use_bias
       snake_case					:   int         =					block_size
       snake_case					:   int         =					num_random_blocks
       snake_case					:   Optional[int]         =					classifier_dropout







class _lowerCAmelCase       (   snake_case_			):







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

       '''simple docstring'''




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





