





'''simple docstring'''

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


__lowerCAmelCase				:      Any						      =logging.get_logger(__name__)

__lowerCAmelCase				:      Any						      ={
    "microsoft/focalnet-tiny": "https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json",
}






class   UpperCAmelCase      (			UpperCamelCase__     ,			UpperCamelCase__							):
 __lowercase  						=							"""focalnet"""
 def __init__(							self :str		,			lowercase_ :Dict=2_24		,			lowercase_ :str=4		,			lowercase_ :Optional[int]=3		,			lowercase_ :Optional[int]=96		,			lowercase_ :Tuple=False		,			lowercase_ :List[str]=[1_92, 3_84, 7_68, 7_68]		,			lowercase_ :Dict=[2, 2, 6, 2]		,			lowercase_ :str=[2, 2, 2, 2]		,			lowercase_ :Optional[int]=[3, 3, 3, 3]		,			lowercase_ :List[Any]="gelu"		,			lowercase_ :List[Any]=4.0		,			lowercase_ :int=0.0		,			lowercase_ :List[str]=0.1		,			lowercase_ :List[str]=False		,			lowercase_ :Optional[Any]=1E-4		,			lowercase_ :Tuple=False		,			lowercase_ :Optional[Any]=False		,			lowercase_ :Union[str, Any]=False		,			lowercase_ :List[Any]=0.0_2		,			lowercase_ :List[str]=1E-5		,			lowercase_ :Optional[int]=32		,			lowercase_ :List[Any]=None		,			lowercase_ :Any=None		,			**lowercase_ :Dict		,			)->				Union[str, Any]:
     super().__init__(**lowercase_				)

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










'''simple docstring'''

# 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


__lowerCAmelCase				:      Optional[int]						      ={
    "configuration_vivit": ["VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "VivitConfig"],
}
try:
  if not is_vision_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __lowerCAmelCase				:      int						      =["VivitImageProcessor"]


try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __lowerCAmelCase				:      int						      =[
      "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

  __lowerCAmelCase				:      List[Any]						      =_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)



