

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


_A		:				Any									=       logging.get_logger(__name__)



class        a					(			lowercase__     ,lowercase__   ):
     UpperCAmelCase__ :  Any						      =	"maskformer-swin"

     UpperCAmelCase__ :  Optional[Any]						      =	{
         "num_attention_heads": "num_heads",
         "num_hidden_layers": "num_layers",
     }





     def __init__(    self					:				Any    ,	SCREAMING_SNAKE_CASE_					:				Dict=224    ,	SCREAMING_SNAKE_CASE_					:				List[str]=4    ,	SCREAMING_SNAKE_CASE_					:				int=3    ,	SCREAMING_SNAKE_CASE_					:				int=96    ,	SCREAMING_SNAKE_CASE_					:				Tuple=[2, 2, 6, 2]    ,	SCREAMING_SNAKE_CASE_					:				Tuple=[3, 6, 12, 24]    ,	SCREAMING_SNAKE_CASE_					:				Union[str, Any]=7    ,	SCREAMING_SNAKE_CASE_					:				Union[str, Any]=4.0    ,	SCREAMING_SNAKE_CASE_					:				Any=True    ,	SCREAMING_SNAKE_CASE_					:				Tuple=0.0    ,	SCREAMING_SNAKE_CASE_					:				List[str]=0.0    ,	SCREAMING_SNAKE_CASE_					:				List[str]=0.1    ,	SCREAMING_SNAKE_CASE_					:				List[Any]="gelu"    ,	SCREAMING_SNAKE_CASE_					:				Optional[int]=False    ,	SCREAMING_SNAKE_CASE_					:				Tuple=0.02    ,	SCREAMING_SNAKE_CASE_					:				List[Any]=1E-5    ,	SCREAMING_SNAKE_CASE_					:				Dict=None    ,	SCREAMING_SNAKE_CASE_					:				Dict=None    ,	**SCREAMING_SNAKE_CASE_					:				Tuple    ,	):
        super().__init__(**__lowerCamelCase							)

        __lowerCamelCase:				int     =	image_size
        __lowerCamelCase:				Dict     =	patch_size
        __lowerCamelCase:				Optional[int]     =	num_channels
        __lowerCamelCase:				Optional[Any]     =	embed_dim
        __lowerCamelCase:				str     =	depths
        __lowerCamelCase:				str     =	len(__lowerCamelCase							)
        __lowerCamelCase:				Dict     =	num_heads
        __lowerCamelCase:				Optional[Any]     =	window_size
        __lowerCamelCase:				str     =	mlp_ratio
        __lowerCamelCase:				Tuple     =	qkv_bias
        __lowerCamelCase:				Optional[Any]     =	hidden_dropout_prob
        __lowerCamelCase:				List[str]     =	attention_probs_dropout_prob
        __lowerCamelCase:				Union[str, Any]     =	drop_path_rate
        __lowerCamelCase:				int     =	hidden_act
        __lowerCamelCase:				Optional[Any]     =	use_absolute_embeddings
        __lowerCamelCase:				Dict     =	layer_norm_eps
        __lowerCamelCase:				int     =	initializer_range
        # we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
        # this indicates the channel dimension after the last stage of the model
        __lowerCamelCase:				List[str]     =	int(embed_dim * 2 ** (len(__lowerCamelCase							) - 1)							)
        __lowerCamelCase:				Optional[Any]     =	["stem"] + [F'stage{idx}' for idx in range(1    ,	len(__lowerCamelCase							) + 1							)]
        __lowerCamelCase:				int     =	get_aligned_output_features_output_indices(
            out_features=__lowerCamelCase    ,	out_indices=__lowerCamelCase    ,	stage_names=self.stage_names							)






from ..utils import (
    OptionalDependencyNotAvailable,
    is_flax_available,
    is_scipy_available,
    is_torch_available,
    is_torchsde_available,
)


try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   from ..utils.dummy_pt_objects import *  # noqa F403
else:
   from .scheduling_consistency_models import CMStochasticIterativeScheduler
   from .scheduling_ddim import DDIMScheduler
   from .scheduling_ddim_inverse import DDIMInverseScheduler
   from .scheduling_ddim_parallel import DDIMParallelScheduler
   from .scheduling_ddpm import DDPMScheduler
   from .scheduling_ddpm_parallel import DDPMParallelScheduler
   from .scheduling_deis_multistep import DEISMultistepScheduler
   from .scheduling_dpmsolver_multistep import DPMSolverMultistepScheduler
   from .scheduling_dpmsolver_multistep_inverse import DPMSolverMultistepInverseScheduler
   from .scheduling_dpmsolver_singlestep import DPMSolverSinglestepScheduler
   from .scheduling_euler_ancestral_discrete import EulerAncestralDiscreteScheduler
   from .scheduling_euler_discrete import EulerDiscreteScheduler
   from .scheduling_heun_discrete import HeunDiscreteScheduler
   from .scheduling_ipndm import IPNDMScheduler
   from .scheduling_k_dpm_2_ancestral_discrete import KDPMaAncestralDiscreteScheduler
   from .scheduling_k_dpm_2_discrete import KDPMaDiscreteScheduler
   from .scheduling_karras_ve import KarrasVeScheduler
   from .scheduling_pndm import PNDMScheduler
   from .scheduling_repaint import RePaintScheduler
   from .scheduling_sde_ve import ScoreSdeVeScheduler
   from .scheduling_sde_vp import ScoreSdeVpScheduler
   from .scheduling_unclip import UnCLIPScheduler
   from .scheduling_unipc_multistep import UniPCMultistepScheduler
   from .scheduling_utils import KarrasDiffusionSchedulers, SchedulerMixin
   from .scheduling_vq_diffusion import VQDiffusionScheduler

try:
   if not is_flax_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   from ..utils.dummy_flax_objects import *  # noqa F403
else:
   from .scheduling_ddim_flax import FlaxDDIMScheduler
   from .scheduling_ddpm_flax import FlaxDDPMScheduler
   from .scheduling_dpmsolver_multistep_flax import FlaxDPMSolverMultistepScheduler
   from .scheduling_karras_ve_flax import FlaxKarrasVeScheduler
   from .scheduling_lms_discrete_flax import FlaxLMSDiscreteScheduler
   from .scheduling_pndm_flax import FlaxPNDMScheduler
   from .scheduling_sde_ve_flax import FlaxScoreSdeVeScheduler
   from .scheduling_utils_flax import (
       FlaxKarrasDiffusionSchedulers,
       FlaxSchedulerMixin,
       FlaxSchedulerOutput,
       broadcast_to_shape_from_left,
   )


try:
   if not (is_torch_available() and is_scipy_available()):
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   from ..utils.dummy_torch_and_scipy_objects import *  # noqa F403
else:
   from .scheduling_lms_discrete import LMSDiscreteScheduler

try:
   if not (is_torch_available() and is_torchsde_available()):
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   from ..utils.dummy_torch_and_torchsde_objects import *  # noqa F403
else:
   from .scheduling_dpmsolver_sde import DPMSolverSDEScheduler


