






from __future__ import annotations

import unittest

from transformers import RoFormerConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
       import tensorflow as tf

       from transformers import (
           TFRoFormerForCausalLM,
           TFRoFormerForMaskedLM,
           TFRoFormerForMultipleChoice,
           TFRoFormerForQuestionAnswering,
           TFRoFormerForSequenceClassification,
           TFRoFormerForTokenClassification,
           TFRoFormerModel,
       )
       from transformers.models.roformer.modeling_tf_roformer import (
           TFRoFormerSelfAttention,
           TFRoFormerSinusoidalPositionalEmbedding,
       )
class     a    :



      """simple docstring"""


      def __init__(      self					:			str		,      __lowercase					:			Dict		,      __lowercase					:			List[Any]=13		,      __lowercase					:			List[str]=7		,      __lowercase					:			Union[str, Any]=True		,      __lowercase					:			Any=True		,      __lowercase					:			Any=True		,      __lowercase					:			str=True		,      __lowercase					:			Any=99		,      __lowercase					:			int=32		,      __lowercase					:			Tuple=2		,      __lowercase					:			List[str]=4		,      __lowercase					:			Tuple=37		,      __lowercase					:			Tuple="gelu"		,      __lowercase					:			Any=0.1		,      __lowercase					:			List[Any]=0.1		,      __lowercase					:			Tuple=512		,      __lowercase					:			Union[str, Any]=16		,      __lowercase					:			str=2		,      __lowercase					:			Union[str, Any]=0.02		,      __lowercase					:			Union[str, Any]=3		,      __lowercase					:			List[str]=4		,      __lowercase					:			str=None		,      )							->      Dict:
        __UpperCAmelCase							:	Dict           =  parent
        __UpperCAmelCase							:	Union[str, Any]           =  13
        __UpperCAmelCase							:	List[str]           =  7
        __UpperCAmelCase							:	Dict           =  True
        __UpperCAmelCase							:	Any           =  True
        __UpperCAmelCase							:	int           =  True
        __UpperCAmelCase							:	Tuple           =  True
        __UpperCAmelCase							:	Optional[Any]           =  99
        __UpperCAmelCase							:	List[Any]           =  32
        __UpperCAmelCase							:	List[Any]           =  2
        __UpperCAmelCase							:	Dict           =  4
        __UpperCAmelCase							:	Any           =  37
        __UpperCAmelCase							:	Optional[Any]           =  """gelu"""
        __UpperCAmelCase							:	Tuple           =  0.1
        __UpperCAmelCase							:	Dict           =  0.1
        __UpperCAmelCase							:	int           =  512
        __UpperCAmelCase							:	Optional[Any]           =  16
        __UpperCAmelCase							:	Optional[int]           =  2
        __UpperCAmelCase							:	Optional[Any]           =  0.02
        __UpperCAmelCase							:	Optional[Any]           =  3
        __UpperCAmelCase							:	Optional[Any]           =  4
        __UpperCAmelCase							:	str           =  None
      def 	UpperCAmelCase      (      self					:			List[str]					)							->      str:
        __UpperCAmelCase							:	Optional[int]           =  ids_tensor([self.batch_size, self.seq_length]		,      self.vocab_size					)

        __UpperCAmelCase							:	str           =  None
        if self.use_input_mask:
          __UpperCAmelCase							:	Any           =  random_attention_mask([self.batch_size, self.seq_length]					)

        __UpperCAmelCase							:	int           =  None
        if self.use_token_type_ids:
          __UpperCAmelCase							:	Optional[Any]           =  ids_tensor([self.batch_size, self.seq_length]		,      self.type_vocab_size					)

        __UpperCAmelCase							:	Dict           =  None
        __UpperCAmelCase							:	str           =  None
        __UpperCAmelCase							:	Tuple           =  None
        if self.use_labels:
          __UpperCAmelCase							:	List[str]           =  ids_tensor([self.batch_size]		,      self.type_sequence_label_size					)
          __UpperCAmelCase							:	Optional[int]           =  ids_tensor([self.batch_size, self.seq_length]		,      self.num_labels					)
          __UpperCAmelCase							:	Union[str, Any]           =  ids_tensor([self.batch_size]		,      self.num_choices					)

        __UpperCAmelCase							:	List[Any]           =  RoFormerConfig(
            vocab_size=self.vocab_size		,      hidden_size=self.hidden_size		,      num_hidden_layers=self.num_hidden_layers		,      num_attention_heads=self.num_attention_heads		,      intermediate_size=self.intermediate_size		,      hidden_act=self.hidden_act		,      hidden_dropout_prob=self.hidden_dropout_prob		,      attention_probs_dropout_prob=self.attention_probs_dropout_prob		,      max_position_embeddings=self.max_position_embeddings		,      type_vocab_size=self.type_vocab_size		,      initializer_range=self.initializer_range		,      return_dict=__lowercase		,      )

        return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels
      def 	UpperCAmelCase      (      self					:			Optional[Any]		,      __lowercase					:			List[Any]		,      __lowercase					:			int		,      __lowercase					:			Dict		,      __lowercase					:			List[Any]		,      __lowercase					:			Optional[Any]		,      __lowercase					:			str		,      __lowercase					:			str					)							->      Optional[Any]:
        __UpperCAmelCase							:	Union[str, Any]           =  TFRoFormerModel(config=__lowercase					)
        __UpperCAmelCase							:	List[str]           =  {"""input_ids""": input_ids, """attention_mask""": input_mask, """token_type_ids""": token_type_ids}

        __UpperCAmelCase							:	Dict           =  [input_ids, input_mask]
        __UpperCAmelCase							:	List[str]           =  model(__lowercase					)

        __UpperCAmelCase							:	Optional[int]           =  model(__lowercase					)

        self.parent.assertEqual(result.last_hidden_state.shape		,      (self.batch_size, self.seq_length, self.hidden_size)					)
      def 	UpperCAmelCase      (      self					:			List[str]		,      __lowercase					:			int		,      __lowercase					:			List[Any]		,      __lowercase					:			Union[str, Any]		,      __lowercase					:			List[Any]		,      __lowercase					:			Dict		,      __lowercase					:			List[Any]		,      __lowercase					:			Dict					)							->      List[Any]:
        __UpperCAmelCase							:	Optional[int]           =  True
        __UpperCAmelCase							:	str           =  TFRoFormerForCausalLM(config=__lowercase					)
        __UpperCAmelCase							:	int           =  {
            """input_ids""": input_ids,
            """attention_mask""": input_mask,
            """token_type_ids""": token_type_ids,
        }
        __UpperCAmelCase							:	List[Any]           =  model(__lowercase					)["""logits"""]
        self.parent.assertListEqual(
            list(prediction_scores.numpy().shape					)		,      [self.batch_size, self.seq_length, self.vocab_size]					)
      def 	UpperCAmelCase      (      self					:			List[Any]		,      __lowercase					:			Optional[int]		,      __lowercase					:			str		,      __lowercase					:			Any		,      __lowercase					:			Tuple		,      __lowercase					:			Any		,      __lowercase					:			List[str]		,      __lowercase					:			Optional[Any]					)							->      Optional[Any]:
        __UpperCAmelCase							:	Union[str, Any]           =  TFRoFormerForMaskedLM(config=__lowercase					)
        __UpperCAmelCase							:	str           =  {
            """input_ids""": input_ids,
            """attention_mask""": input_mask,
            """token_type_ids""": token_type_ids,
        }
        __UpperCAmelCase							:	str           =  model(__lowercase					)
        self.parent.assertEqual(result.logits.shape		,      (self.batch_size, self.seq_length, self.vocab_size)					)
      def 	UpperCAmelCase      (      self					:			Union[str, Any]		,      __lowercase					:			List[Any]		,      __lowercase					:			List[str]		,      __lowercase					:			List[str]		,      __lowercase					:			Union[str, Any]		,      __lowercase					:			List[str]		,      __lowercase					:			Any		,      __lowercase					:			int					)							->      Any:
        __UpperCAmelCase							:	str           =  self.num_labels
        __UpperCAmelCase							:	int           =  TFRoFormerForSequenceClassification(config=__lowercase					)
        __UpperCAmelCase							:	Optional[Any]           =  {
            """input_ids""": input_ids,
            """attention_mask""": input_mask,
            """token_type_ids""": token_type_ids,
        }

        __UpperCAmelCase							:	Optional[Any]           =  model(__lowercase					)
        self.parent.assertEqual(result.logits.shape		,      (self.batch_size, self.num_labels)					)
      def 	UpperCAmelCase      (      self					:			Optional[Any]		,      __lowercase					:			Any		,      __lowercase					:			Dict		,      __lowercase					:			List[str]		,      __lowercase					:			int		,      __lowercase					:			Any		,      __lowercase					:			List[str]		,      __lowercase					:			List[str]					)							->      Any:
        __UpperCAmelCase							:	str           =  self.num_choices
        __UpperCAmelCase							:	Tuple           =  TFRoFormerForMultipleChoice(config=__lowercase					)
        __UpperCAmelCase							:	Union[str, Any]           =  tf.tile(tf.expand_dims(__lowercase		,      1					)		,      (1, self.num_choices, 1)					)
        __UpperCAmelCase							:	Union[str, Any]           =  tf.tile(tf.expand_dims(__lowercase		,      1					)		,      (1, self.num_choices, 1)					)
        __UpperCAmelCase							:	Tuple           =  tf.tile(tf.expand_dims(__lowercase		,      1					)		,      (1, self.num_choices, 1)					)
        __UpperCAmelCase							:	Optional[int]           =  {
            """input_ids""": multiple_choice_inputs_ids,
            """attention_mask""": multiple_choice_input_mask,
            """token_type_ids""": multiple_choice_token_type_ids,
        }
        __UpperCAmelCase							:	int           =  model(__lowercase					)
        self.parent.assertEqual(result.logits.shape		,      (self.batch_size, self.num_choices)					)
      def 	UpperCAmelCase      (      self					:			List[Any]		,      __lowercase					:			Union[str, Any]		,      __lowercase					:			List[str]		,      __lowercase					:			Optional[int]		,      __lowercase					:			str		,      __lowercase					:			int		,      __lowercase					:			str		,      __lowercase					:			Tuple					)							->      Dict:
        __UpperCAmelCase							:	Optional[Any]           =  self.num_labels
        __UpperCAmelCase							:	int           =  TFRoFormerForTokenClassification(config=__lowercase					)
        __UpperCAmelCase							:	str           =  {
            """input_ids""": input_ids,
            """attention_mask""": input_mask,
            """token_type_ids""": token_type_ids,
        }
        __UpperCAmelCase							:	Tuple           =  model(__lowercase					)
        self.parent.assertEqual(result.logits.shape		,      (self.batch_size, self.seq_length, self.num_labels)					)
      def 	UpperCAmelCase      (      self					:			Dict		,      __lowercase					:			Tuple		,      __lowercase					:			Optional[Any]		,      __lowercase					:			Any		,      __lowercase					:			str		,      __lowercase					:			int		,      __lowercase					:			List[Any]		,      __lowercase					:			List[Any]					)							->      Union[str, Any]:
        __UpperCAmelCase							:	Tuple           =  TFRoFormerForQuestionAnswering(config=__lowercase					)
        __UpperCAmelCase							:	str           =  {
            """input_ids""": input_ids,
            """attention_mask""": input_mask,
            """token_type_ids""": token_type_ids,
        }

        __UpperCAmelCase							:	List[Any]           =  model(__lowercase					)
        self.parent.assertEqual(result.start_logits.shape		,      (self.batch_size, self.seq_length)					)
        self.parent.assertEqual(result.end_logits.shape		,      (self.batch_size, self.seq_length)					)




      def 	UpperCAmelCase      (      self					:			Optional[int]					)							->      Tuple:
        __UpperCAmelCase							:	Optional[Any]           =  self.prepare_config_and_inputs()
        (
            (
            __UpperCAmelCase
        )      , (
            __UpperCAmelCase
        )      , (
            __UpperCAmelCase
        )      , (
            __UpperCAmelCase
        )      , (
            __UpperCAmelCase
        )      , (
            __UpperCAmelCase
        )      , (
            __UpperCAmelCase
        )      , 
        )							:	Optional[Any]           =  config_and_inputs
        __UpperCAmelCase							:	int           =  {"""input_ids""": input_ids, """token_type_ids""": token_type_ids, """attention_mask""": input_mask}
        return config, inputs_dict


@require_tf
class     a    ( lowercase__							,       lowercase__							,       unittest.TestCase   ):



      """simple docstring"""


      a  : Optional[Any]							       =	(
          (
              TFRoFormerModel,
              TFRoFormerForCausalLM,
              TFRoFormerForMaskedLM,
              TFRoFormerForQuestionAnswering,
              TFRoFormerForSequenceClassification,
              TFRoFormerForTokenClassification,
              TFRoFormerForMultipleChoice,
          )
          if is_tf_available()
          else ()
      )
      a  : str							       =	(
          {
              'feature-extraction': TFRoFormerModel,
              'fill-mask': TFRoFormerForMaskedLM,
              'question-answering': TFRoFormerForQuestionAnswering,
              'text-classification': TFRoFormerForSequenceClassification,
              'text-generation': TFRoFormerForCausalLM,
              'token-classification': TFRoFormerForTokenClassification,
              'zero-shot': TFRoFormerForSequenceClassification,
          }
          if is_tf_available()
          else {}
      )

      a  : Optional[int]							       =	False
      a  : Any							       =	False
      def 	UpperCAmelCase      (      self					:			List[Any]		,      __lowercase					:			Any		,      __lowercase					:			List[Any]		,      __lowercase					:			int		,      __lowercase					:			str		,      __lowercase					:			str					)							->      Dict:
        if pipeline_test_casse_name == "TextGenerationPipelineTests":
          return True

        return False
      def 	UpperCAmelCase      (      self					:			List[str]					)							->      Tuple:
        __UpperCAmelCase							:	List[str]           =  TFRoFormerModelTester(self					)
        __UpperCAmelCase							:	Optional[Any]           =  ConfigTester(self		,      config_class=__lowercase		,      hidden_size=37					)
      def 	UpperCAmelCase      (      self					:			Dict					)							->      Tuple:
        self.config_tester.run_common_tests()
      def 	UpperCAmelCase      (      self					:			Any					)							->      Optional[Any]:
        __UpperCAmelCase							:	Any           =  self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_model(*__lowercase					)
      def 	UpperCAmelCase      (      self					:			List[str]					)							->      int:
        __UpperCAmelCase							:	int           =  self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_masked_lm(*__lowercase					)
      def 	UpperCAmelCase      (      self					:			List[Any]					)							->      str:
        __UpperCAmelCase							:	List[str]           =  self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_lm_head(*__lowercase					)
      def 	UpperCAmelCase      (      self					:			str					)							->      List[str]:
        __UpperCAmelCase							:	Tuple           =  self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_multiple_choice(*__lowercase					)
      def 	UpperCAmelCase      (      self					:			Union[str, Any]					)							->      Tuple:
        __UpperCAmelCase							:	str           =  self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_question_answering(*__lowercase					)
      def 	UpperCAmelCase      (      self					:			List[Any]					)							->      Optional[int]:
        __UpperCAmelCase							:	Optional[Any]           =  self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_sequence_classification(*__lowercase					)
      def 	UpperCAmelCase      (      self					:			Optional[int]					)							->      Optional[Any]:
        __UpperCAmelCase							:	List[Any]           =  self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_token_classification(*__lowercase					)




      @slow
      def 	UpperCAmelCase      (      self					:			Dict					)							->      Optional[Any]:
        __UpperCAmelCase							:	List[str]           =  TFRoFormerModel.from_pretrained("""junnyu/roformer_chinese_base"""					)
        self.assertIsNotNone(__lowercase					)


@require_tf
class     a    ( unittest.TestCase   ):



      """simple docstring"""


      @slow
      def 	UpperCAmelCase      (      self					:			Tuple					)							->      Optional[Any]:
        __UpperCAmelCase							:	Optional[int]           =  TFRoFormerForMaskedLM.from_pretrained("""junnyu/roformer_chinese_base"""					)
        __UpperCAmelCase							:	Optional[int]           =  tf.constant([[0, 1, 2, 3, 4, 5]]					)
        __UpperCAmelCase							:	Optional[Any]           =  model(__lowercase					)[0]

        # TODO Replace vocab size
        __UpperCAmelCase							:	Optional[int]           =  50000

        __UpperCAmelCase							:	Tuple           =  [1, 6, vocab_size]
        self.assertEqual(output.shape		,      __lowercase					)

        print(output[:, :3, :3]					)

        # TODO Replace values below with what was printed above.
        __UpperCAmelCase							:	Union[str, Any]           =  tf.constant(
            [
                [
                    [-0.12_053_341, -1.0_264_901, 0.29_221_946],
                    [-1.5_133_783, 0.197_433, 0.15_190_607],
                    [-5.0_135_403, -3.900_256, -0.84_038_764],
                ]
            ]					)
        tf.debugging.assert_near(output[:, :3, :3]		,      __lowercase		,      atol=1e-4					)


@require_tf
class     a    ( unittest.TestCase   ):



      """simple docstring"""


      a  : Optional[int]							       =	1e-4
      def 	UpperCAmelCase      (      self					:			int					)							->      Tuple:
        __UpperCAmelCase							:	int           =  tf.constant([[4, 10]]					)
        __UpperCAmelCase							:	List[Any]           =  TFRoFormerSinusoidalPositionalEmbedding(num_positions=6		,      embedding_dim=6					)

        __UpperCAmelCase							:	List[str]           =  emba(input_ids.shape					)
        __UpperCAmelCase							:	Optional[int]           =  tf.constant(
            [[0.0_000, 0.0_000, 0.0_000, 1.0_000, 1.0_000, 1.0_000], [0.8_415, 0.0_464, 0.0_022, 0.5_403, 0.9_989, 1.0_000]]					)

        tf.debugging.assert_near(__lowercase		,      __lowercase		,      atol=self.tolerance					)




      def 	UpperCAmelCase      (      self					:			int					)							->      str:
        __UpperCAmelCase							:	Any           =  tf.constant(
            [
                [0.0_000, 0.0_000, 0.0_000, 0.0_000, 0.0_000],
                [0.8_415, 0.8_219, 0.8_020, 0.7_819, 0.7_617],
                [0.9_093, 0.9_364, 0.9_581, 0.9_749, 0.9_870],
            ]					)
        __UpperCAmelCase							:	Tuple           =  TFRoFormerSinusoidalPositionalEmbedding(num_positions=512		,      embedding_dim=512					)
        emba([2, 16, 512]					)
        __UpperCAmelCase							:	str           =  emba.weight[:3, :5]

        tf.debugging.assert_near(__lowercase		,      __lowercase		,      atol=self.tolerance					)


@require_tf
class     a    ( unittest.TestCase   ):



      """simple docstring"""


      a  : str							       =	1e-4
      def 	UpperCAmelCase      (      self					:			int					)							->      List[Any]:
        # 2,12,16,64
        __UpperCAmelCase							:	Dict           =  tf.reshape(tf.range(2 * 12 * 16 * 64		,      dtype=tf.floataa					)		,      shape=(2, 12, 16, 64)					) / 100

        __UpperCAmelCase							:	Union[str, Any]           =  -tf.reshape(tf.range(2 * 12 * 16 * 64		,      dtype=tf.floataa					)		,      shape=(2, 12, 16, 64)					) / 100

        __UpperCAmelCase							:	Optional[Any]           =  TFRoFormerSinusoidalPositionalEmbedding(num_positions=32		,      embedding_dim=64					)
        __UpperCAmelCase							:	Any           =  embed_positions([2, 16, 768]					)[None, None, :, :]

        __UpperCAmelCase      , __UpperCAmelCase							:	List[Any]           =  TFRoFormerSelfAttention.apply_rotary_position_embeddings(
            __lowercase		,      __lowercase		,      __lowercase					)

        __UpperCAmelCase							:	Tuple           =  tf.constant(
            [
                [0.0_000, 0.0_100, 0.0_200, 0.0_300, 0.0_400, 0.0_500, 0.0_600, 0.0_700],
                [-0.2_012, 0.8_897, 0.0_263, 0.9_401, 0.2_074, 0.9_463, 0.3_481, 0.9_343],
                [-1.7_057, 0.6_271, -1.2_145, 1.3_897, -0.6_303, 1.7_647, -0.1_173, 1.8_985],
                [-2.1_731, -1.6_397, -2.7_358, 0.2_854, -2.1_840, 1.7_183, -1.3_018, 2.4_871],
                [0.2_717, -3.6_173, -2.9_206, -2.1_988, -3.6_638, 0.3_858, -2.9_155, 2.2_980],
                [3.9_859, -2.1_580, -0.7_984, -4.4_904, -4.1_181, -2.0_252, -4.4_782, 1.1_253],
            ]					)
        __UpperCAmelCase							:	Dict           =  tf.constant(
            [
                [0.0_000, -0.0_100, -0.0_200, -0.0_300, -0.0_400, -0.0_500, -0.0_600, -0.0_700],
                [0.2_012, -0.8_897, -0.0_263, -0.9_401, -0.2_074, -0.9_463, -0.3_481, -0.9_343],
                [1.7_057, -0.6_271, 1.2_145, -1.3_897, 0.6_303, -1.7_647, 0.1_173, -1.8_985],
                [2.1_731, 1.6_397, 2.7_358, -0.2_854, 2.1_840, -1.7_183, 1.3_018, -2.4_871],
                [-0.2_717, 3.6_173, 2.9_206, 2.1_988, 3.6_638, -0.3_858, 2.9_155, -2.2_980],
                [-3.9_859, 2.1_580, 0.7_984, 4.4_904, 4.1_181, 2.0_252, 4.4_782, -1.1_253],
            ]					)

        tf.debugging.assert_near(query_layer[0, 0, :6, :8]		,      __lowercase		,      atol=self.tolerance					)
        tf.debugging.assert_near(key_layer[0, 0, :6, :8]		,      __lowercase		,      atol=self.tolerance					)










import warnings
from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


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

a		:       List[Any]			     = {
    "nvidia/segformer-b0-finetuned-ade-512-512": (
        "https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512/resolve/main/config.json"
    ),
    # See all SegFormer models at https://huggingface.co/models?filter=segformer
}
class     a    ( lowercase__   ):



      """simple docstring"""


      a  : int							       =	'segformer'
      def __init__(      self					:			Dict		,      __lowercase					:			str=3		,      __lowercase					:			Dict=4		,      __lowercase					:			Any=[2, 2, 2, 2]		,      __lowercase					:			Optional[int]=[8, 4, 2, 1]		,      __lowercase					:			List[str]=[32, 64, 160, 256]		,      __lowercase					:			Union[str, Any]=[7, 3, 3, 3]		,      __lowercase					:			Optional[int]=[4, 2, 2, 2]		,      __lowercase					:			Any=[1, 2, 5, 8]		,      __lowercase					:			List[str]=[4, 4, 4, 4]		,      __lowercase					:			Any="gelu"		,      __lowercase					:			Optional[int]=0.0		,      __lowercase					:			Dict=0.0		,      __lowercase					:			Optional[Any]=0.1		,      __lowercase					:			int=0.02		,      __lowercase					:			Optional[int]=0.1		,      __lowercase					:			Optional[Any]=1e-6		,      __lowercase					:			Tuple=256		,      __lowercase					:			List[Any]=255		,      **__lowercase					:			Union[str, Any]		,      )							->      List[Any]:
        super().__init__(**__lowercase					)

        if "reshape_last_stage" in kwargs and kwargs["reshape_last_stage"] is False:
          warnings.warn(
              """Reshape_last_stage is set to False in this config. This argument is deprecated and will soon be"""
              """ removed, as the behaviour will default to that of reshape_last_stage = True."""		,      __lowercase		,      )

        __UpperCAmelCase							:	Tuple           =  num_channels
        __UpperCAmelCase							:	Any           =  num_encoder_blocks
        __UpperCAmelCase							:	List[Any]           =  depths
        __UpperCAmelCase							:	Dict           =  sr_ratios
        __UpperCAmelCase							:	int           =  hidden_sizes
        __UpperCAmelCase							:	Optional[Any]           =  patch_sizes
        __UpperCAmelCase							:	List[Any]           =  strides
        __UpperCAmelCase							:	List[str]           =  mlp_ratios
        __UpperCAmelCase							:	Tuple           =  num_attention_heads
        __UpperCAmelCase							:	List[str]           =  hidden_act
        __UpperCAmelCase							:	Tuple           =  hidden_dropout_prob
        __UpperCAmelCase							:	Dict           =  attention_probs_dropout_prob
        __UpperCAmelCase							:	Any           =  classifier_dropout_prob
        __UpperCAmelCase							:	Optional[int]           =  initializer_range
        __UpperCAmelCase							:	Optional[Any]           =  drop_path_rate
        __UpperCAmelCase							:	int           =  layer_norm_eps
        __UpperCAmelCase							:	Dict           =  decoder_hidden_size
        __UpperCAmelCase							:	Tuple           =  kwargs.get("""reshape_last_stage"""		,      __lowercase					)
        __UpperCAmelCase							:	int           =  semantic_loss_ignore_index


class     a    ( lowercase__   ):



      """simple docstring"""


      a  : Union[str, Any]							       =	version.parse('1.11'   )
      @property
      def 	UpperCAmelCase      (      self					:			Union[str, Any]					)							->      Mapping[str, Mapping[int, str]]:
        return OrderedDict(
            [
                ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
            ]					)
      @property
      def 	UpperCAmelCase      (      self					:			Optional[Any]					)							->      float:
        return 1e-4




      @property
      def 	UpperCAmelCase      (      self					:			str					)							->      int:
        return 12


