

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__										=      {
    '''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_      (	_lowerCamelCase		,  _lowerCamelCase      ):


  """simple docstring"""
  SCREAMING_SNAKE_CASE__					:			List[str]					    =   """convnext"""



  def __init__(						self     :					Any  ,	A_     :					Optional[int]=3  ,	A_     :					Optional[int]=4  ,	A_     :					Union[str, Any]=4  ,	A_     :					List[Any]=None  ,	A_     :					str=None  ,	A_     :					Optional[Any]="gelu"  ,	A_     :					Union[str, Any]=0.02  ,	A_     :					List[Any]=1E-1_2  ,	A_     :					Union[str, Any]=1E-6  ,	A_     :					List[Any]=0.0  ,	A_     :					str=224  ,	A_     :					Optional[int]=None  ,	A_     :					List[Any]=None  ,	**A_     :					str  ,	)       ->			str:
      super().__init__(**__UpperCamelCase						)

      SCREAMING_SNAKE_CASE__         =    num_channels
      SCREAMING_SNAKE_CASE__         =    patch_size
      SCREAMING_SNAKE_CASE__         =    num_stages
      SCREAMING_SNAKE_CASE__         =    [96, 192, 384, 768] if hidden_sizes is None else hidden_sizes
      SCREAMING_SNAKE_CASE__         =    [3, 3, 9, 3] if depths is None else depths
      SCREAMING_SNAKE_CASE__         =    hidden_act
      SCREAMING_SNAKE_CASE__         =    initializer_range
      SCREAMING_SNAKE_CASE__         =    layer_norm_eps
      SCREAMING_SNAKE_CASE__         =    layer_scale_init_value
      SCREAMING_SNAKE_CASE__         =    drop_path_rate
      SCREAMING_SNAKE_CASE__         =    image_size
      SCREAMING_SNAKE_CASE__         =    ['stem'] + [f"stage{idx}" for idx in range(1  ,	len(self.depths						) + 1						)]
      SCREAMING_SNAKE_CASE__         =    get_aligned_output_features_output_indices(
          out_features=__UpperCamelCase  ,	out_indices=__UpperCamelCase  ,	stage_names=self.stage_names						)







class  UpperCamelCase_      (	_lowerCamelCase      ):


  """simple docstring"""
  SCREAMING_SNAKE_CASE__					:			List[Any]					    =   version.parse("""1.11"""      )



  @property
  def   _UpperCamelCase     (						self     :					Union[str, Any]						)       ->			Mapping[str, Mapping[int, str]]:
      return OrderedDict(
          [
              ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
          ]						)







  @property
  def   _UpperCamelCase     (						self     :					Optional[int]						)       ->			float:
      return 1E-5



from ...utils import is_transformers_available
from .pipeline_latent_diffusion_superresolution import LDMSuperResolutionPipeline


if is_transformers_available():
				from .pipeline_latent_diffusion import LDMBertModel, LDMTextToImagePipeline


