

"""simple docstring"""






from collections import OrderedDict
from typing import Mapping

from packaging import version

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


A 			=  logging.get_logger(__name__)

A 			=  {
    '''microsoft/resnet-50''': '''https://huggingface.co/microsoft/resnet-50/blob/main/config.json''',
}




class 				__lowercase			(			_UpperCamelCase   ,      _UpperCamelCase							):







					'''simple docstring'''




					__lowerCAmelCase  =  '''resnet'''
					__lowerCAmelCase  =  ['''basic''', '''bottleneck''']







					def __init__(						self	,			_UpperCAmelCase=3	,			_UpperCAmelCase=64	,			_UpperCAmelCase=[256, 512, 1024, 2048]	,			_UpperCAmelCase=[3, 4, 6, 3]	,			_UpperCAmelCase="bottleneck"	,			_UpperCAmelCase="relu"	,			_UpperCAmelCase=False	,			_UpperCAmelCase=None	,			_UpperCAmelCase=None	,			**_UpperCAmelCase	,			):
									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     )}"""     )
									__a :						Any			       =  num_channels
									__a :						Optional[Any]			       =  embedding_size
									__a :						Union[str, Any]			       =  hidden_sizes
									__a :						List[Any]			       =  depths
									__a :						Any			       =  layer_type
									__a :						Optional[int]			       =  hidden_act
									__a :						Dict			       =  downsample_in_first_stage
									__a :						str			       =  ['''stem'''] + [f"""stage{idx}""" for idx in range(1	,			len(_UpperCAmelCase     ) + 1     )]
									__a :						Optional[int]			       =  get_aligned_output_features_output_indices(
									    out_features=_UpperCAmelCase	,			out_indices=_UpperCAmelCase	,			stage_names=self.stage_names     )






class 				__lowercase			(			_UpperCamelCase							):







					'''simple docstring'''




					__lowerCAmelCase  =  version.parse('''1.11'''							)







					@property
					def  _lowerCamelCase		(						self     ):
									return OrderedDict(
									    [
									        ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
									    ]     )







					@property
					def  _lowerCamelCase		(						self     ):
									return 1e-3






"""simple docstring"""






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


A 			=  {
    '''configuration_jukebox''': [
        '''JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''JukeboxConfig''',
        '''JukeboxPriorConfig''',
        '''JukeboxVQVAEConfig''',
    ],
    '''tokenization_jukebox''': ['''JukeboxTokenizer'''],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A 			=  [
		    '''JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''JukeboxModel''',
		    '''JukeboxPreTrainedModel''',
		    '''JukeboxVQVAE''',
		    '''JukeboxPrior''',
		]

if TYPE_CHECKING:
		from .configuration_jukebox import (
		    JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    JukeboxConfig,
		    JukeboxPriorConfig,
		    JukeboxVQVAEConfig,
		)
		from .tokenization_jukebox import JukeboxTokenizer

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_jukebox import (
				    JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST,
				    JukeboxModel,
				    JukeboxPreTrainedModel,
				    JukeboxPrior,
				    JukeboxVQVAE,
				)

else:
		import sys

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