



'''simple docstring'''



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


lowerCAmelCase_     :       Tuple								=						logging.get_logger(__name__)

lowerCAmelCase_     :       str								=						{
    'microsoft/focalnet-tiny': 'https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json',
}
class 	lowerCamelCase_							(					snake_case_    ,				snake_case_			):
      _lowerCAmelCase     :   int	     =				'focalnet'







      def __init__(  self   :      Optional[Any]				,    lowerCAmelCase__   :      Tuple=2_24				,    lowerCAmelCase__   :      Tuple=4				,    lowerCAmelCase__   :      Optional[int]=3				,    lowerCAmelCase__   :      str=96				,    lowerCAmelCase__   :      str=False				,    lowerCAmelCase__   :      Union[str, Any]=[1_92, 3_84, 7_68, 7_68]				,    lowerCAmelCase__   :      Optional[int]=[2, 2, 6, 2]				,    lowerCAmelCase__   :      List[str]=[2, 2, 2, 2]				,    lowerCAmelCase__   :      List[Any]=[3, 3, 3, 3]				,    lowerCAmelCase__   :      Optional[int]="gelu"				,    lowerCAmelCase__   :      Optional[Any]=4.0				,    lowerCAmelCase__   :      List[str]=0.0				,    lowerCAmelCase__   :      Optional[int]=0.1				,    lowerCAmelCase__   :      Optional[Any]=False				,    lowerCAmelCase__   :      Dict=1e-4				,    lowerCAmelCase__   :      List[str]=False				,    lowerCAmelCase__   :      str=False				,    lowerCAmelCase__   :      Any=False				,    lowerCAmelCase__   :      Union[str, Any]=0.02				,    lowerCAmelCase__   :      List[str]=1e-5				,    lowerCAmelCase__   :      Any=32				,    lowerCAmelCase__   :      Optional[int]=None				,    lowerCAmelCase__   :      Union[str, Any]=None				,    **lowerCAmelCase__   :      List[str]				,    ):

             """simple docstring"""
             super().__init__(**lowerCAmelCase__				)

             SCREAMING_SNAKE_CASE					:      str     					=			image_size
             SCREAMING_SNAKE_CASE					:      List[Any]     					=			patch_size
             SCREAMING_SNAKE_CASE					:      Optional[int]     					=			num_channels
             SCREAMING_SNAKE_CASE					:      Optional[int]     					=			embed_dim
             SCREAMING_SNAKE_CASE					:      List[Any]     					=			use_conv_embed
             SCREAMING_SNAKE_CASE					:      Dict     					=			hidden_sizes
             SCREAMING_SNAKE_CASE					:      int     					=			depths
             SCREAMING_SNAKE_CASE					:      Dict     					=			focal_levels
             SCREAMING_SNAKE_CASE					:      List[str]     					=			focal_windows
             SCREAMING_SNAKE_CASE					:      Dict     					=			hidden_act
             SCREAMING_SNAKE_CASE					:      Dict     					=			mlp_ratio
             SCREAMING_SNAKE_CASE					:      Optional[int]     					=			hidden_dropout_prob
             SCREAMING_SNAKE_CASE					:      Any     					=			drop_path_rate
             SCREAMING_SNAKE_CASE					:      str     					=			use_layerscale
             SCREAMING_SNAKE_CASE					:      List[str]     					=			layerscale_value
             SCREAMING_SNAKE_CASE					:      str     					=			use_post_layernorm
             SCREAMING_SNAKE_CASE					:      List[str]     					=			use_post_layernorm_in_modulation
             SCREAMING_SNAKE_CASE					:      List[str]     					=			normalize_modulator
             SCREAMING_SNAKE_CASE					:      Union[str, Any]     					=			initializer_range
             SCREAMING_SNAKE_CASE					:      List[Any]     					=			layer_norm_eps
             SCREAMING_SNAKE_CASE					:      str     					=			encoder_stride
             SCREAMING_SNAKE_CASE					:      int     					=			['''stem'''] + [F"""stage{idx}""" for idx in range(1				,    len(self.depths				) + 1				)]
             SCREAMING_SNAKE_CASE					:      Optional[int]     					=			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


lowerCAmelCase_     :       Tuple								=						{
    'configuration_tapas': ['TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP', 'TapasConfig'],
    'tokenization_tapas': ['TapasTokenizer'],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							lowerCAmelCase_     :       Dict								=						[
							    '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:
							lowerCAmelCase_     :       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

							lowerCAmelCase_     :       List[Any]								=						_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




