





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


snake_case_           =      logging.get_logger(__name__)

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

class 		SCREAMING_SNAKE_CASE__    (	_UpperCAmelCase						,				_UpperCAmelCase  ):
      A_						:    List[Any]							=   'focalnet'


      def __init__(self	:				Optional[int]    ,      a__	:				Optional[int]=224    ,      a__	:				Tuple=4    ,      a__	:				Tuple=3    ,      a__	:				Dict=96    ,      a__	:				List[str]=False    ,      a__	:				Tuple=[192, 384, 768, 768]    ,      a__	:				Union[str, Any]=[2, 2, 6, 2]    ,      a__	:				List[str]=[2, 2, 2, 2]    ,      a__	:				List[Any]=[3, 3, 3, 3]    ,      a__	:				int="gelu"    ,      a__	:				Dict=4.0    ,      a__	:				Union[str, Any]=0.0    ,      a__	:				Optional[Any]=0.1    ,      a__	:				List[Any]=False    ,      a__	:				List[str]=1E-4    ,      a__	:				List[str]=False    ,      a__	:				int=False    ,      a__	:				Any=False    ,      a__	:				Optional[Any]=0.0_2    ,      a__	:				Any=1E-5    ,      a__	:				List[str]=32    ,      a__	:				str=None    ,      a__	:				Union[str, Any]=None    ,      **a__	:				Tuple    ,      ):





         """simple docstring"""



         super().__init__(**lowerCamelCase_				)

         __snake_case								=       image_size
         __snake_case								=       patch_size
         __snake_case								=       num_channels
         __snake_case								=       embed_dim
         __snake_case								=       use_conv_embed
         __snake_case								=       hidden_sizes
         __snake_case								=       depths
         __snake_case								=       focal_levels
         __snake_case								=       focal_windows
         __snake_case								=       hidden_act
         __snake_case								=       mlp_ratio
         __snake_case								=       hidden_dropout_prob
         __snake_case								=       drop_path_rate
         __snake_case								=       use_layerscale
         __snake_case								=       layerscale_value
         __snake_case								=       use_post_layernorm
         __snake_case								=       use_post_layernorm_in_modulation
         __snake_case								=       normalize_modulator
         __snake_case								=       initializer_range
         __snake_case								=       layer_norm_eps
         __snake_case								=       encoder_stride
         __snake_case								=       ['''stem'''] + [f"""stage{idx}""" for idx in range(1    ,      len(self.depths				) + 1				)]
         __snake_case	,     __snake_case								=       get_aligned_output_features_output_indices(
             out_features=lowerCamelCase_    ,      out_indices=lowerCamelCase_    ,      stage_names=self.stage_names				)








# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


snake_case_           =      {
    'configuration_vivit': ['VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'VivitConfig'],
}
try:
    if not is_vision_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    snake_case_           =      ['VivitImageProcessor']


try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    snake_case_           =      [
        'VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST',
        'VivitModel',
        'VivitPreTrainedModel',
        'VivitForVideoClassification',
    ]


if TYPE_CHECKING:
    from .configuration_vivit import VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, VivitConfig

    try:
        if not is_vision_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .image_processing_vivit import VivitImageProcessor

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_vivit import (
            VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
            VivitForVideoClassification,
            VivitModel,
            VivitPreTrainedModel,
        )


else:
    import sys

    snake_case_           =      _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

