"""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


__UpperCamelCase       :    Tuple         =		logging.get_logger(__name__)

__UpperCamelCase       :    List[str]         =		{
    "facebook/convnext-tiny-224": "https://huggingface.co/facebook/convnext-tiny-224/resolve/main/config.json",
    # See all ConvNeXT models at https://huggingface.co/models?filter=convnext
}
class   UpperCAmelCase_	(				UpperCAmelCase__,    UpperCAmelCase__   ):
    snake_case_											=      "convnext"
    def __init__(	self			:       Optional[int]   ,						_lowercase			:       List[str]=3   ,						_lowercase			:       List[str]=4   ,						_lowercase			:       Optional[int]=4   ,						_lowercase			:       Dict=None   ,						_lowercase			:       Tuple=None   ,						_lowercase			:       List[str]="gelu"   ,						_lowercase			:       List[Any]=0.02   ,						_lowercase			:       Dict=1e-1_2   ,						_lowercase			:       Tuple=1e-6   ,						_lowercase			:       Dict=0.0   ,						_lowercase			:       Optional[int]=2_2_4   ,						_lowercase			:       List[Any]=None   ,						_lowercase			:       Any=None   ,						**_lowercase			:       int   ,						)						->    str:
       super().__init__(**lowerCamelCase__		)

       _lowercase							     =       num_channels
       _lowercase							     =       patch_size
       _lowercase							     =       num_stages
       _lowercase							     =       [9_6, 1_9_2, 3_8_4, 7_6_8] if hidden_sizes is None else hidden_sizes
       _lowercase							     =       [3, 3, 9, 3] if depths is None else depths
       _lowercase							     =       hidden_act
       _lowercase							     =       initializer_range
       _lowercase							     =       layer_norm_eps
       _lowercase							     =       layer_scale_init_value
       _lowercase							     =       drop_path_rate
       _lowercase							     =       image_size
       _lowercase							     =       ["stem"] + [f"""stage{idx}""" for idx in range(1   ,						len(self.depths		) + 1		)]
       _lowercase							     =       get_aligned_output_features_output_indices(
           out_features=lowerCamelCase__   ,						out_indices=lowerCamelCase__   ,						stage_names=self.stage_names		)
class   UpperCAmelCase_	(				UpperCAmelCase__   ):
    snake_case_											=      version.parse("""1.11"""   )
    @property
    def 		_lowerCamelCase      (	self			:       Dict		)						->    Mapping[str, Mapping[int, str]]:
       return OrderedDict(
           [
               ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
           ]		)




    @property
    def 		_lowerCamelCase      (	self			:       str		)						->    float:
       return 1e-5



'''simple docstring'''


from ..utils import deprecate
from .attention_processor import (  # noqa: F401
    Attention,
    AttentionProcessor,
    AttnAddedKVProcessor,
    AttnProcessor2_0,
    LoRAAttnProcessor,
    LoRALinearLayer,
    LoRAXFormersAttnProcessor,
    SlicedAttnAddedKVProcessor,
    SlicedAttnProcessor,
    XFormersAttnProcessor,
)
from .attention_processor import AttnProcessor as AttnProcessorRename  # noqa: F401


deprecate(
    'cross_attention',
    '0.20.0',
    'Importing from cross_attention is deprecated. Please import from diffusers.models.attention_processor instead.',
    standard_warn=False,
)


lowerCamelCase__     						=  AttentionProcessor






class 						lowerCAmelCase__      (      UpperCAmelCase__						):




			def __init__(		self	:  Union[str, Any]						,	*lowerCamelCase__	:  int						,	**lowerCamelCase__	:  List[str]			) ->Any:



					'''simple docstring'''







					_UpperCAmelCase		:							Dict             =   F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
					deprecate("cross_attention"						,	"0.20.0"						,	lowerCamelCase__						,	standard_warn=lowerCamelCase__			)
					super().__init__(*lowerCamelCase__						,	**lowerCamelCase__			)






class 						lowerCAmelCase__      (      UpperCAmelCase__						):




			def __init__(		self	:  Optional[Any]						,	*lowerCamelCase__	:  Any						,	**lowerCamelCase__	:  Tuple			) ->List[Any]:



					'''simple docstring'''







					_UpperCAmelCase		:							int             =   F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
					deprecate("cross_attention"						,	"0.20.0"						,	lowerCamelCase__						,	standard_warn=lowerCamelCase__			)
					super().__init__(*lowerCamelCase__						,	**lowerCamelCase__			)






class 						lowerCAmelCase__      (      UpperCAmelCase__						):




			def __init__(		self	:  List[Any]						,	*lowerCamelCase__	:  List[Any]						,	**lowerCamelCase__	:  List[str]			) ->List[Any]:



					'''simple docstring'''







					_UpperCAmelCase		:							List[str]             =   F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
					deprecate("cross_attention"						,	"0.20.0"						,	lowerCamelCase__						,	standard_warn=lowerCamelCase__			)
					super().__init__(*lowerCamelCase__						,	**lowerCamelCase__			)






class 						lowerCAmelCase__      (      UpperCAmelCase__						):




			def __init__(		self	:  int						,	*lowerCamelCase__	:  Tuple						,	**lowerCamelCase__	:  Union[str, Any]			) ->int:



					'''simple docstring'''







					_UpperCAmelCase		:							Dict             =   F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
					deprecate("cross_attention"						,	"0.20.0"						,	lowerCamelCase__						,	standard_warn=lowerCamelCase__			)
					super().__init__(*lowerCamelCase__						,	**lowerCamelCase__			)






class 						lowerCAmelCase__      (      UpperCAmelCase__						):




			def __init__(		self	:  int						,	*lowerCamelCase__	:  List[str]						,	**lowerCamelCase__	:  Tuple			) ->Union[str, Any]:



					'''simple docstring'''







					_UpperCAmelCase		:							Optional[Any]             =   F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
					deprecate("cross_attention"						,	"0.20.0"						,	lowerCamelCase__						,	standard_warn=lowerCamelCase__			)
					super().__init__(*lowerCamelCase__						,	**lowerCamelCase__			)






class 						lowerCAmelCase__      (      UpperCAmelCase__						):




			def __init__(		self	:  List[Any]						,	*lowerCamelCase__	:  int						,	**lowerCamelCase__	:  Optional[int]			) ->Optional[int]:



					'''simple docstring'''







					_UpperCAmelCase		:							List[Any]             =   F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
					deprecate("cross_attention"						,	"0.20.0"						,	lowerCamelCase__						,	standard_warn=lowerCamelCase__			)
					super().__init__(*lowerCamelCase__						,	**lowerCamelCase__			)






class 						lowerCAmelCase__      (      UpperCAmelCase__						):




			def __init__(		self	:  Any						,	*lowerCamelCase__	:  Optional[Any]						,	**lowerCamelCase__	:  Union[str, Any]			) ->List[str]:



					'''simple docstring'''







					_UpperCAmelCase		:							int             =   F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
					deprecate("cross_attention"						,	"0.20.0"						,	lowerCamelCase__						,	standard_warn=lowerCamelCase__			)
					super().__init__(*lowerCamelCase__						,	**lowerCamelCase__			)






class 						lowerCAmelCase__      (      UpperCAmelCase__						):




			def __init__(		self	:  Optional[Any]						,	*lowerCamelCase__	:  List[Any]						,	**lowerCamelCase__	:  Dict			) ->Any:



					'''simple docstring'''







					_UpperCAmelCase		:							int             =   F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
					deprecate("cross_attention"						,	"0.20.0"						,	lowerCamelCase__						,	standard_warn=lowerCamelCase__			)
					super().__init__(*lowerCamelCase__						,	**lowerCamelCase__			)



