


"""simple docstring"""


import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING


a_       							=    logging.get_logger(__name__)
class snake_case      (  _UpperCamelCase):
		__UpperCamelCase           =			'upernet'







		def __init__(					self      :       Tuple    ,   a__      :       Optional[int]=None    ,   a__      :       Dict=5_12    ,   a__      :       List[Any]=0.0_2    ,   a__      :       Optional[int]=[1, 2, 3, 6]    ,   a__      :       str=True    ,   a__      :       Optional[int]=0.4    ,   a__      :       Tuple=3_84    ,   a__      :       Tuple=2_56    ,   a__      :       List[Any]=1    ,   a__      :       Tuple=False    ,   a__      :       str=2_55    ,   **a__      :       str    ,   )       ->						str:





						'''simple docstring'''







						super().__init__(**a__		)

						if backbone_config is None:
										logger.info("`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone."		)
										_A					  =			CONFIG_MAPPING["resnet"](out_features=["stage1", "stage2", "stage3", "stage4"]		)
						elif isinstance(a__    ,   a__		):
										_A					  =			backbone_config.get("model_type"		)
										_A					  =			CONFIG_MAPPING[backbone_model_type]
										_A					  =			config_class.from_dict(a__		)

						_A					  =			backbone_config
						_A					  =			hidden_size
						_A					  =			initializer_range
						_A					  =			pool_scales
						_A					  =			use_auxiliary_head
						_A					  =			auxiliary_loss_weight
						_A					  =			auxiliary_in_channels
						_A					  =			auxiliary_channels
						_A					  =			auxiliary_num_convs
						_A					  =			auxiliary_concat_input
						_A					  =			loss_ignore_index







		def  a_ (					self      :       Any		)       ->						List[str]:





						'''simple docstring'''







						_A					  =			copy.deepcopy(self.__dict__		)
						_A					  =			self.backbone_config.to_dict()
						_A					  =			self.__class__.model_type
						return output



"""simple docstring"""


from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


a_       							=    {
    "configuration_roformer": ["ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "RoFormerConfig", "RoFormerOnnxConfig"],
    "tokenization_roformer": ["RoFormerTokenizer"],
}

try:
		if not is_tokenizers_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		a_       							=    ["RoFormerTokenizerFast"]

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		a_       							=    [
		    "ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
		    "RoFormerForCausalLM",
		    "RoFormerForMaskedLM",
		    "RoFormerForMultipleChoice",
		    "RoFormerForQuestionAnswering",
		    "RoFormerForSequenceClassification",
		    "RoFormerForTokenClassification",
		    "RoFormerLayer",
		    "RoFormerModel",
		    "RoFormerPreTrainedModel",
		    "load_tf_weights_in_roformer",
		]


try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		a_       							=    [
		    "TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
		    "TFRoFormerForCausalLM",
		    "TFRoFormerForMaskedLM",
		    "TFRoFormerForMultipleChoice",
		    "TFRoFormerForQuestionAnswering",
		    "TFRoFormerForSequenceClassification",
		    "TFRoFormerForTokenClassification",
		    "TFRoFormerLayer",
		    "TFRoFormerModel",
		    "TFRoFormerPreTrainedModel",
		]


try:
		if not is_flax_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		a_       							=    [
		    "FLAX_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
		    "FlaxRoFormerForMaskedLM",
		    "FlaxRoFormerForMultipleChoice",
		    "FlaxRoFormerForQuestionAnswering",
		    "FlaxRoFormerForSequenceClassification",
		    "FlaxRoFormerForTokenClassification",
		    "FlaxRoFormerModel",
		    "FlaxRoFormerPreTrainedModel",
		]


if TYPE_CHECKING:
		from .configuration_roformer import ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, RoFormerConfig, RoFormerOnnxConfig
		from .tokenization_roformer import RoFormerTokenizer

		try:
				if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_roformer_fast import RoFormerTokenizerFast

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_roformer import (
				    ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    RoFormerForCausalLM,
				    RoFormerForMaskedLM,
				    RoFormerForMultipleChoice,
				    RoFormerForQuestionAnswering,
				    RoFormerForSequenceClassification,
				    RoFormerForTokenClassification,
				    RoFormerLayer,
				    RoFormerModel,
				    RoFormerPreTrainedModel,
				    load_tf_weights_in_roformer,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_roformer import (
				    TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFRoFormerForCausalLM,
				    TFRoFormerForMaskedLM,
				    TFRoFormerForMultipleChoice,
				    TFRoFormerForQuestionAnswering,
				    TFRoFormerForSequenceClassification,
				    TFRoFormerForTokenClassification,
				    TFRoFormerLayer,
				    TFRoFormerModel,
				    TFRoFormerPreTrainedModel,
				)

		try:
				if not is_flax_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_flax_roformer import (
				    FLAX_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    FlaxRoFormerForMaskedLM,
				    FlaxRoFormerForMultipleChoice,
				    FlaxRoFormerForQuestionAnswering,
				    FlaxRoFormerForSequenceClassification,
				    FlaxRoFormerForTokenClassification,
				    FlaxRoFormerModel,
				    FlaxRoFormerPreTrainedModel,
				)


else:
		import sys

		a_       							=    _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)