






'''simple docstring'''



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


SCREAMING_SNAKE_CASE							=						{
    'configuration_x_clip': [
        'XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'XCLIPConfig',
        'XCLIPTextConfig',
        'XCLIPVisionConfig',
    ],
    'processing_x_clip': ['XCLIPProcessor'],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      SCREAMING_SNAKE_CASE							=						[
          'XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST',
          'XCLIPModel',
          'XCLIPPreTrainedModel',
          'XCLIPTextModel',
          'XCLIPVisionModel',
      ]

if TYPE_CHECKING:
      from .configuration_x_clip import (
          XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
          XCLIPConfig,
          XCLIPTextConfig,
          XCLIPVisionConfig,
      )
      from .processing_x_clip import XCLIPProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_x_clip import (
                XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
                XCLIPModel,
                XCLIPPreTrainedModel,
                XCLIPTextModel,
                XCLIPVisionModel,
            )

else:
      import sys

      SCREAMING_SNAKE_CASE							=						_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)






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


A									=  logging.get_logger(__name__)

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


class SCREAMING_SNAKE_CASE	(		__snake_case				,    __snake_case				):






			"""simple docstring"""




			__A    	=	"""bit"""
			__A    	=	["""preactivation""", """bottleneck"""]
			__A    	=	["""SAME""", """VALID"""]


			def __init__(     self			,					__UpperCamelCase=3			,					__UpperCamelCase=64			,					__UpperCamelCase=[2_56, 5_12, 10_24, 20_48]			,					__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			,					):

				"""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_   		=			global_padding.upper()
					else:
						raise ValueError(f"""Padding strategy {global_padding} not supported"""				)
				snake_case_   		=			num_channels
				snake_case_   		=			embedding_size
				snake_case_   		=			hidden_sizes
				snake_case_   		=			depths
				snake_case_   		=			layer_type
				snake_case_   		=			hidden_act
				snake_case_   		=			global_padding
				snake_case_   		=			num_groups
				snake_case_   		=			drop_path_rate
				snake_case_   		=			embedding_dynamic_padding
				snake_case_   		=			output_stride
				snake_case_   		=			width_factor

				snake_case_   		=			['stem'] + [f"""stage{idx}""" for idx in range(1			,					len(__UpperCamelCase				) + 1				)]
				snake_case_		,							snake_case_   		=			get_aligned_output_features_output_indices(
				    out_features=__UpperCamelCase			,					out_indices=__UpperCamelCase			,					stage_names=self.stage_names				)
