"""simple docstring"""




_a      :		Union[str, Any]           =   '0.21.0'

from .accelerator import Accelerator
from .big_modeling import (
    cpu_offload,
    cpu_offload_with_hook,
    disk_offload,
    dispatch_model,
    init_empty_weights,
    init_on_device,
    load_checkpoint_and_dispatch,
)
from .data_loader import skip_first_batches
from .launchers import debug_launcher, notebook_launcher
from .state import PartialState
from .utils import (
    DeepSpeedPlugin,
    DistributedDataParallelKwargs,
    DistributedType,
    FullyShardedDataParallelPlugin,
    GradScalerKwargs,
    InitProcessGroupKwargs,
    find_executable_batch_size,
    infer_auto_device_map,
    is_rich_available,
    load_checkpoint_in_model,
    synchronize_rng_states,
)


if is_rich_available():
     from .utils import rich





"""simple docstring"""




from ...configuration_utils import PretrainedConfig
from ...utils import logging


_a      :		List[Any]           =   logging.get_logger(__name__)

_a      :		Any           =   {
    'microsoft/swinv2-tiny-patch4-window8-256': (
        'https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json'
    ),
}
class 						__A							( SCREAMING_SNAKE_CASE_		):
     _UpperCamelCase							:			int							=		"swinv2"

     _UpperCamelCase							:			List[str]							=		{
         "num_attention_heads": "num_heads",
         "num_hidden_layers": "num_layers",
     }






     def __init__(		self				,     a__=224				,     a__=4				,     a__=3				,     a__=96				,     a__=[2, 2, 6, 2]				,     a__=[3, 6, 12, 24]				,     a__=7				,     a__=4.0				,     a__=True				,     a__=0.0				,     a__=0.0				,     a__=0.1				,     a__="gelu"				,     a__=False				,     a__=0.0_2				,     a__=1e-5				,     a__=32				,     **a__				,     ):
       super().__init__(**a__  )

       _lowerCAmelCase						:       int  			=     image_size
       _lowerCAmelCase						:       Optional[Any]  			=     patch_size
       _lowerCAmelCase						:       Any  			=     num_channels
       _lowerCAmelCase						:       List[Any]  			=     embed_dim
       _lowerCAmelCase						:       Optional[int]  			=     depths
       _lowerCAmelCase						:       List[Any]  			=     len(a__  )
       _lowerCAmelCase						:       Any  			=     num_heads
       _lowerCAmelCase						:       Tuple  			=     window_size
       _lowerCAmelCase						:       Tuple  			=     mlp_ratio
       _lowerCAmelCase						:       Any  			=     qkv_bias
       _lowerCAmelCase						:       Optional[int]  			=     hidden_dropout_prob
       _lowerCAmelCase						:       Tuple  			=     attention_probs_dropout_prob
       _lowerCAmelCase						:       str  			=     drop_path_rate
       _lowerCAmelCase						:       List[str]  			=     hidden_act
       _lowerCAmelCase						:       List[str]  			=     use_absolute_embeddings
       _lowerCAmelCase						:       Optional[int]  			=     layer_norm_eps
       _lowerCAmelCase						:       List[Any]  			=     initializer_range
       _lowerCAmelCase						:       Any  			=     encoder_stride
       # we set the hidden_size attribute in order to make Swinv2 work with VisionEncoderDecoderModel
       # this indicates the channel dimension after the last stage of the model
       _lowerCAmelCase						:       Tuple  			=     int(embed_dim * 2 ** (len(a__  ) - 1)  )
       _lowerCAmelCase						:       Tuple  			=     (0, 0, 0, 0)




