



"""simple docstring"""






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


_lowercase : Any      						=						logging.get_logger(__name__)

_lowercase : Optional[int]      						=						{
    "google/bit-50": "https://huggingface.co/google/bit-50/resolve/main/config.json",
}

class        __SCREAMING_SNAKE_CASE	(      lowerCAmelCase_		,   lowerCAmelCase_   ):


					'''simple docstring'''





					_a   			=							'bit'
					_a   			=							['preactivation', 'bottleneck']
					_a   			=							['SAME', 'VALID']



					def __init__(       self							:  List[str],  lowerCamelCase							:  Tuple=3,  lowerCamelCase							:  Any=64,  lowerCamelCase							:  Union[str, Any]=[256, 512, 1024, 2048],  lowerCamelCase							:  Optional[int]=[3, 4, 6, 3],  lowerCamelCase							:  Dict="preactivation",  lowerCamelCase							:  Optional[int]="relu",  lowerCamelCase							:  List[Any]=None,  lowerCamelCase							:  Any=32,  lowerCamelCase							:  Any=0.0,  lowerCamelCase							:  Dict=False,  lowerCamelCase							:  Tuple=32,  lowerCamelCase							:  str=1,  lowerCamelCase							:  Union[str, Any]=None,  lowerCamelCase							:  Optional[int]=None,  **lowerCamelCase							:  Optional[int],  )->					Any:
								super().__init__(**lowerCamelCase     )
								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:
														lowerCamelCase__		:		Dict			=global_padding.upper()
											else:
														raise ValueError(F'''Padding strategy {global_padding} not supported'''     )
								lowerCamelCase__		:		Optional[Any]			=num_channels
								lowerCamelCase__		:		List[Any]			=embedding_size
								lowerCamelCase__		:		Dict			=hidden_sizes
								lowerCamelCase__		:		Optional[int]			=depths
								lowerCamelCase__		:		int			=layer_type
								lowerCamelCase__		:		Dict			=hidden_act
								lowerCamelCase__		:		List[str]			=global_padding
								lowerCamelCase__		:		str			=num_groups
								lowerCamelCase__		:		Tuple			=drop_path_rate
								lowerCamelCase__		:		Any			=embedding_dynamic_padding
								lowerCamelCase__		:		Dict			=output_stride
								lowerCamelCase__		:		List[str]			=width_factor

								lowerCamelCase__		:		str			=['''stem'''] + [F'''stage{idx}''' for idx in range(1,  len(lowerCamelCase     ) + 1     )]
								lowerCamelCase__	,   lowerCamelCase__		:		Union[str, Any]			=get_aligned_output_features_output_indices(
								    out_features=lowerCamelCase,  out_indices=lowerCamelCase,  stage_names=self.stage_names     )









"""simple docstring"""






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


_lowercase : List[Any]      						=						{
    "configuration_tapas": ["TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP", "TapasConfig"],
    "tokenization_tapas": ["TapasTokenizer"],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase : Optional[Any]      						=						[
		    "TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST",
		    "TapasForMaskedLM",
		    "TapasForQuestionAnswering",
		    "TapasForSequenceClassification",
		    "TapasModel",
		    "TapasPreTrainedModel",
		    "load_tf_weights_in_tapas",
		]
try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase : str      						=						[
		    "TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST",
		    "TFTapasForMaskedLM",
		    "TFTapasForQuestionAnswering",
		    "TFTapasForSequenceClassification",
		    "TFTapasModel",
		    "TFTapasPreTrainedModel",
		]


if TYPE_CHECKING:
		from .configuration_tapas import TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP, TapasConfig
		from .tokenization_tapas import TapasTokenizer

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tapas import (
				    TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TapasForMaskedLM,
				    TapasForQuestionAnswering,
				    TapasForSequenceClassification,
				    TapasModel,
				    TapasPreTrainedModel,
				    load_tf_weights_in_tapas,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_tapas import (
				    TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFTapasForMaskedLM,
				    TFTapasForQuestionAnswering,
				    TFTapasForSequenceClassification,
				    TFTapasModel,
				    TFTapasPreTrainedModel,
				)


else:
		import sys

		_lowercase : List[str]      						=						_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)




