





'''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[Any] =logging.get_logger(__name__)

a__							:							Tuple ={
    '''microsoft/focalnet-tiny''': '''https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json''',
}

class      snake_case     (    __lowerCamelCase			,       __lowerCamelCase       ):




 """simple docstring"""



 SCREAMING_SNAKE_CASE_	:					int					="focalnet"






 def __init__(       self       :							List[Any]							,	__A       :							int=2_2_4							,	__A       :							Tuple=4							,	__A       :							Tuple=3							,	__A       :							List[str]=9_6							,	__A       :							Any=False							,	__A       :							List[Any]=[1_9_2, 3_8_4, 7_6_8, 7_6_8]							,	__A       :							Union[str, Any]=[2, 2, 6, 2]							,	__A       :							str=[2, 2, 2, 2]							,	__A       :							Optional[int]=[3, 3, 3, 3]							,	__A       :							Optional[Any]="gelu"							,	__A       :							Any=4.0							,	__A       :							List[Any]=0.0							,	__A       :							Union[str, Any]=0.1							,	__A       :							str=False							,	__A       :							Any=1e-4							,	__A       :							List[Any]=False							,	__A       :							Union[str, Any]=False							,	__A       :							Union[str, Any]=False							,	__A       :							List[Any]=0.02							,	__A       :							Tuple=1e-5							,	__A       :							List[str]=3_2							,	__A       :							Optional[int]=None							,	__A       :							int=None							,	**__A       :							List[Any]							,	):
        super().__init__(**__A	)

        __UpperCamelCase       =  image_size
        __UpperCamelCase       =  patch_size
        __UpperCamelCase       =  num_channels
        __UpperCamelCase       =  embed_dim
        __UpperCamelCase       =  use_conv_embed
        __UpperCamelCase       =  hidden_sizes
        __UpperCamelCase       =  depths
        __UpperCamelCase       =  focal_levels
        __UpperCamelCase       =  focal_windows
        __UpperCamelCase       =  hidden_act
        __UpperCamelCase       =  mlp_ratio
        __UpperCamelCase       =  hidden_dropout_prob
        __UpperCamelCase       =  drop_path_rate
        __UpperCamelCase       =  use_layerscale
        __UpperCamelCase       =  layerscale_value
        __UpperCamelCase       =  use_post_layernorm
        __UpperCamelCase       =  use_post_layernorm_in_modulation
        __UpperCamelCase       =  normalize_modulator
        __UpperCamelCase       =  initializer_range
        __UpperCamelCase       =  layer_norm_eps
        __UpperCamelCase       =  encoder_stride
        __UpperCamelCase       =  ['stem'] + [f'''stage{idx}''' for idx in range(1							,	len(self.depths	) + 1	)]
        __UpperCamelCase       ,						__UpperCamelCase       =  get_aligned_output_features_output_indices(
            out_features=__A							,	out_indices=__A							,	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() and is_transformers_version('''>=''', '''4.25.0''')):
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from ...utils.dummy_torch_and_transformers_objects import (
        VersatileDiffusionDualGuidedPipeline,
        VersatileDiffusionImageVariationPipeline,
        VersatileDiffusionPipeline,
        VersatileDiffusionTextToImagePipeline,
    )
else:
    from .modeling_text_unet import UNetFlatConditionModel
    from .pipeline_versatile_diffusion import VersatileDiffusionPipeline
    from .pipeline_versatile_diffusion_dual_guided import VersatileDiffusionDualGuidedPipeline
    from .pipeline_versatile_diffusion_image_variation import VersatileDiffusionImageVariationPipeline
    from .pipeline_versatile_diffusion_text_to_image import VersatileDiffusionTextToImagePipeline
