
'''simple docstring'''







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


_snake_case				:   List[str]     =				logging.get_logger(__name__)


class 			lowerCAmelCase (				__UpperCAmelCase		,     __UpperCAmelCase			):
		a							:					List[str]       =					"""maskformer-swin"""

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




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

								_SCREAMING_SNAKE_CASE				= image_size
								_SCREAMING_SNAKE_CASE				= patch_size
								_SCREAMING_SNAKE_CASE				= num_channels
								_SCREAMING_SNAKE_CASE				= embed_dim
								_SCREAMING_SNAKE_CASE				= depths
								_SCREAMING_SNAKE_CASE				= len(UpperCamelCase      )
								_SCREAMING_SNAKE_CASE				= num_heads
								_SCREAMING_SNAKE_CASE				= window_size
								_SCREAMING_SNAKE_CASE				= mlp_ratio
								_SCREAMING_SNAKE_CASE				= qkv_bias
								_SCREAMING_SNAKE_CASE				= hidden_dropout_prob
								_SCREAMING_SNAKE_CASE				= attention_probs_dropout_prob
								_SCREAMING_SNAKE_CASE				= drop_path_rate
								_SCREAMING_SNAKE_CASE				= hidden_act
								_SCREAMING_SNAKE_CASE				= use_absolute_embeddings
								_SCREAMING_SNAKE_CASE				= layer_norm_eps
								_SCREAMING_SNAKE_CASE				= 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
								_SCREAMING_SNAKE_CASE				= int(embed_dim * 2 ** (len(UpperCamelCase      ) - 1)      )
								_SCREAMING_SNAKE_CASE				= ["stem"] + [F'stage{idx}' for idx in range(1					,						len(UpperCamelCase      ) + 1      )]
								_SCREAMING_SNAKE_CASE,							_SCREAMING_SNAKE_CASE				= get_aligned_output_features_output_indices(
								    out_features=UpperCamelCase					,						out_indices=UpperCamelCase					,						stage_names=self.stage_names      )

'''simple docstring'''







# Lint as: python3
# pylint: enable=line-too-long
# pylint: disable=g-import-not-at-top,g-bad-import-order,wrong-import-position

_snake_case				:   Union[str, Any]     =				"""2.13.1"""

import platform

import pyarrow
from packaging import version


if version.parse(platform.python_version()) < version.parse("""3.7"""):
						raise ImportWarning(
						    """To use `datasets`, Python>=3.7 is required, and the current version of Python doesn't match this condition."""
						)

if version.parse(pyarrow.__version__).major < 8:
						raise ImportWarning(
						    """To use `datasets`, the module `pyarrow>=8.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n"""
						    """If you are running this in a Google Colab, you should probably just restart the runtime to use the right version of `pyarrow`."""
						)

del platform
del pyarrow
del version

from .arrow_dataset import Dataset
from .arrow_reader import ReadInstruction
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
from .combine import concatenate_datasets, interleave_datasets
from .dataset_dict import DatasetDict, IterableDatasetDict
from .download import *
from .features import *
from .fingerprint import disable_caching, enable_caching, is_caching_enabled, set_caching_enabled
from .info import DatasetInfo, MetricInfo
from .inspect import (
    get_dataset_config_info,
    get_dataset_config_names,
    get_dataset_infos,
    get_dataset_split_names,
    inspect_dataset,
    inspect_metric,
    list_datasets,
    list_metrics,
)
from .iterable_dataset import IterableDataset
from .load import load_dataset, load_dataset_builder, load_from_disk, load_metric
from .metric import Metric
from .splits import (
    NamedSplit,
    NamedSplitAll,
    Split,
    SplitBase,
    SplitDict,
    SplitGenerator,
    SplitInfo,
    SubSplitInfo,
    percent,
)
from .tasks import *
from .utils import *
from .utils import logging


# deprecated modules
from datasets import arrow_dataset as _arrow_dataset  # isort:skip
from datasets import utils as _utils  # isort:skip
from datasets.utils import download_manager as _deprecated_download_manager  # isort:skip

_snake_case				:   Tuple     =				concatenate_datasets
_snake_case				:   Any     =				DownloadConfig
_snake_case				:   List[Any]     =				DownloadManager
_snake_case				:   Union[str, Any]     =				DownloadMode
_snake_case				:   Dict     =				DownloadConfig
_snake_case				:   List[str]     =				DownloadMode
_snake_case				:   Union[str, Any]     =				DownloadManager

del _arrow_dataset, _utils, _deprecated_download_manager