


"""simple docstring"""







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


a__    :							List[str]            =					logging.get_logger(__name__)

a__    :							str            =					{
    '''shi-labs/nat-mini-in1k-224''': '''https://huggingface.co/shi-labs/nat-mini-in1k-224/resolve/main/config.json''',
    # See all Nat models at https://huggingface.co/models?filter=nat
}




class 			UpperCamelCase_     (			UpperCamelCase      ,  UpperCamelCase):

	"""simple docstring"""





	snake_case__    :  List[str]    =      "nat"

	snake_case__    :  str    =      {
	    "num_attention_heads": "num_heads",
	    "num_hidden_layers": "num_layers",
	}




	def __init__(			self      :    Optional[Any]      ,      UpperCAmelCase__      :    str=4      ,      UpperCAmelCase__      :    str=3      ,      UpperCAmelCase__      :    int=6_4      ,      UpperCAmelCase__      :    Optional[int]=[3, 4, 6, 5]      ,      UpperCAmelCase__      :    Optional[int]=[2, 4, 8, 1_6]      ,      UpperCAmelCase__      :    str=7      ,      UpperCAmelCase__      :    List[str]=3.0      ,      UpperCAmelCase__      :    List[str]=True      ,      UpperCAmelCase__      :    List[Any]=0.0      ,      UpperCAmelCase__      :    Dict=0.0      ,      UpperCAmelCase__      :    Union[str, Any]=0.1      ,      UpperCAmelCase__      :    Optional[int]="gelu"      ,      UpperCAmelCase__      :    Union[str, Any]=0.02      ,      UpperCAmelCase__      :    Optional[int]=1E-5      ,      UpperCAmelCase__      :    Union[str, Any]=0.0      ,      UpperCAmelCase__      :    str=None      ,      UpperCAmelCase__      :    Tuple=None      ,      **UpperCAmelCase__      :    Union[str, Any]      ,      )	->     List[str]:
						super().__init__(**UpperCAmelCase__       )

						__SCREAMING_SNAKE_CASE						       =    patch_size
						__SCREAMING_SNAKE_CASE						       =    num_channels
						__SCREAMING_SNAKE_CASE						       =    embed_dim
						__SCREAMING_SNAKE_CASE						       =    depths
						__SCREAMING_SNAKE_CASE						       =    len(UpperCAmelCase__       )
						__SCREAMING_SNAKE_CASE						       =    num_heads
						__SCREAMING_SNAKE_CASE						       =    kernel_size
						__SCREAMING_SNAKE_CASE						       =    mlp_ratio
						__SCREAMING_SNAKE_CASE						       =    qkv_bias
						__SCREAMING_SNAKE_CASE						       =    hidden_dropout_prob
						__SCREAMING_SNAKE_CASE						       =    attention_probs_dropout_prob
						__SCREAMING_SNAKE_CASE						       =    drop_path_rate
						__SCREAMING_SNAKE_CASE						       =    hidden_act
						__SCREAMING_SNAKE_CASE						       =    layer_norm_eps
						__SCREAMING_SNAKE_CASE						       =    initializer_range
						# we set the hidden_size attribute in order to make Nat work with VisionEncoderDecoderModel
						# this indicates the channel dimension after the last stage of the model
						__SCREAMING_SNAKE_CASE						       =    int(embed_dim * 2 ** (len(UpperCAmelCase__       ) - 1)       )
						__SCREAMING_SNAKE_CASE						       =    layer_scale_init_value
						__SCREAMING_SNAKE_CASE						       =    ["stem"] + [F"""stage{idx}""" for idx in range(1      ,      len(UpperCAmelCase__       ) + 1       )]
						__SCREAMING_SNAKE_CASE       ,  __SCREAMING_SNAKE_CASE						       =    get_aligned_output_features_output_indices(
						    out_features=UpperCAmelCase__      ,      out_indices=UpperCAmelCase__      ,      stage_names=self.stage_names       )




"""simple docstring"""







from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
		if not (is_transformers_available() and is_torch_available()):
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		from ...utils.dummy_torch_and_transformers_objects import KandinskyPipeline, KandinskyPriorPipeline
else:
		from .pipeline_kandinsky import KandinskyPipeline
		from .pipeline_kandinsky_imgaimg import KandinskyImgaImgPipeline
		from .pipeline_kandinsky_inpaint import KandinskyInpaintPipeline
		from .pipeline_kandinsky_prior import KandinskyPriorPipeline, KandinskyPriorPipelineOutput
		from .text_encoder import MultilingualCLIP
