


'''simple docstring'''







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__       :






      def __init__( self			:List[Any]     ,						SCREAMING_SNAKE_CASE			:Optional[int]     ,						SCREAMING_SNAKE_CASE			:Union[str, Any]=1_3     ,						SCREAMING_SNAKE_CASE			:List[str]=7     ,						SCREAMING_SNAKE_CASE			:Tuple=True     ,						SCREAMING_SNAKE_CASE			:str=True     ,						SCREAMING_SNAKE_CASE			:int=True     ,						SCREAMING_SNAKE_CASE			:Tuple=True     ,						SCREAMING_SNAKE_CASE			:int=9_9     ,						SCREAMING_SNAKE_CASE			:List[str]=3_2     ,						SCREAMING_SNAKE_CASE			:int=2     ,						SCREAMING_SNAKE_CASE			:Optional[int]=4     ,						SCREAMING_SNAKE_CASE			:List[Any]=3_7     ,						SCREAMING_SNAKE_CASE			:Dict="gelu"     ,						SCREAMING_SNAKE_CASE			:Optional[int]=0.1     ,						SCREAMING_SNAKE_CASE			:List[Any]=0.1     ,						SCREAMING_SNAKE_CASE			:Optional[int]=5_1_2     ,						SCREAMING_SNAKE_CASE			:Tuple=1_6     ,						SCREAMING_SNAKE_CASE			:int=2     ,						SCREAMING_SNAKE_CASE			:int=0.02     ,						SCREAMING_SNAKE_CASE			:str=3     ,						SCREAMING_SNAKE_CASE			:Dict=4     ,						SCREAMING_SNAKE_CASE			:Tuple=None     ,						)       ->					str:




             '''simple docstring'''
             _a    : List[str]     					=parent
             _a    : int     					=1_3
             _a    : Optional[int]     					=7
             _a    : int     					=True
             _a    : List[str]     					=True
             _a    : str     					=True
             _a    : int     					=True
             _a    : int     					=9_9
             _a    : str     					=3_2
             _a    : Tuple     					=2
             _a    : int     					=4
             _a    : str     					=3_7
             _a    : List[str]     					="""gelu"""
             _a    : Tuple     					=0.1
             _a    : Tuple     					=0.1
             _a    : Optional[Any]     					=5_1_2
             _a    : Union[str, Any]     					=1_6
             _a    : Optional[Any]     					=2
             _a    : Union[str, Any]     					=0.02
             _a    : Union[str, Any]     					=3
             _a    : Tuple     					=4
             _a    : List[Any]     					=None






      def __UpperCAmelCase       ( self			:Tuple	)       ->					Tuple:




             '''simple docstring'''
             _a    : Union[str, Any]     					=ids_tensor([self.batch_size, self.seq_length]     ,						self.vocab_size	)

             _a    : List[Any]     					=None
             if self.use_input_mask:
                    _a    : int     					=random_attention_mask([self.batch_size, self.seq_length]	)

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

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

             _a    : Optional[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=SCREAMING_SNAKE_CASE     ,						)

             return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels






      def __UpperCAmelCase       ( self			:str     ,						SCREAMING_SNAKE_CASE			:Tuple     ,						SCREAMING_SNAKE_CASE			:List[Any]     ,						SCREAMING_SNAKE_CASE			:List[str]     ,						SCREAMING_SNAKE_CASE			:Any     ,						SCREAMING_SNAKE_CASE			:Tuple     ,						SCREAMING_SNAKE_CASE			:Dict     ,						SCREAMING_SNAKE_CASE			:Optional[int]	)       ->					Optional[int]:




             '''simple docstring'''
             _a    : int     					=TFRoFormerModel(config=SCREAMING_SNAKE_CASE	)
             _a    : int     					={"""input_ids""": input_ids, """attention_mask""": input_mask, """token_type_ids""": token_type_ids}

             _a    : int     					=[input_ids, input_mask]
             _a    : Tuple     					=model(SCREAMING_SNAKE_CASE	)

             _a    : Union[str, Any]     					=model(SCREAMING_SNAKE_CASE	)

             self.parent.assertEqual(result.last_hidden_state.shape     ,						(self.batch_size, self.seq_length, self.hidden_size)	)






      def __UpperCAmelCase       ( self			:int     ,						SCREAMING_SNAKE_CASE			:Dict     ,						SCREAMING_SNAKE_CASE			:Optional[Any]     ,						SCREAMING_SNAKE_CASE			:Optional[int]     ,						SCREAMING_SNAKE_CASE			:Union[str, Any]     ,						SCREAMING_SNAKE_CASE			:Tuple     ,						SCREAMING_SNAKE_CASE			:Dict     ,						SCREAMING_SNAKE_CASE			:List[Any]	)       ->					Optional[Any]:




             '''simple docstring'''
             _a    : Optional[Any]     					=True
             _a    : Any     					=TFRoFormerForCausalLM(config=SCREAMING_SNAKE_CASE	)
             _a    : Union[str, Any]     					={
                 """input_ids""": input_ids,
                 """attention_mask""": input_mask,
                 """token_type_ids""": token_type_ids,
             }
             _a    : Dict     					=model(SCREAMING_SNAKE_CASE	)["""logits"""]
             self.parent.assertListEqual(
                 list(prediction_scores.numpy().shape	)     ,						[self.batch_size, self.seq_length, self.vocab_size]	)






      def __UpperCAmelCase       ( self			:int     ,						SCREAMING_SNAKE_CASE			:List[Any]     ,						SCREAMING_SNAKE_CASE			:Tuple     ,						SCREAMING_SNAKE_CASE			:Any     ,						SCREAMING_SNAKE_CASE			:Dict     ,						SCREAMING_SNAKE_CASE			:str     ,						SCREAMING_SNAKE_CASE			:Any     ,						SCREAMING_SNAKE_CASE			:Tuple	)       ->					Optional[Any]:




             '''simple docstring'''
             _a    : Union[str, Any]     					=TFRoFormerForMaskedLM(config=SCREAMING_SNAKE_CASE	)
             _a    : Optional[int]     					={
                 """input_ids""": input_ids,
                 """attention_mask""": input_mask,
                 """token_type_ids""": token_type_ids,
             }
             _a    : Optional[int]     					=model(SCREAMING_SNAKE_CASE	)
             self.parent.assertEqual(result.logits.shape     ,						(self.batch_size, self.seq_length, self.vocab_size)	)






      def __UpperCAmelCase       ( self			:Tuple     ,						SCREAMING_SNAKE_CASE			:Any     ,						SCREAMING_SNAKE_CASE			:Union[str, Any]     ,						SCREAMING_SNAKE_CASE			:Dict     ,						SCREAMING_SNAKE_CASE			:Tuple     ,						SCREAMING_SNAKE_CASE			:Optional[int]     ,						SCREAMING_SNAKE_CASE			:Dict     ,						SCREAMING_SNAKE_CASE			:Dict	)       ->					str:




             '''simple docstring'''
             _a    : List[str]     					=self.num_labels
             _a    : Optional[int]     					=TFRoFormerForSequenceClassification(config=SCREAMING_SNAKE_CASE	)
             _a    : Optional[int]     					={
                 """input_ids""": input_ids,
                 """attention_mask""": input_mask,
                 """token_type_ids""": token_type_ids,
             }

             _a    : Tuple     					=model(SCREAMING_SNAKE_CASE	)
             self.parent.assertEqual(result.logits.shape     ,						(self.batch_size, self.num_labels)	)






      def __UpperCAmelCase       ( self			:Tuple     ,						SCREAMING_SNAKE_CASE			:int     ,						SCREAMING_SNAKE_CASE			:Union[str, Any]     ,						SCREAMING_SNAKE_CASE			:List[Any]     ,						SCREAMING_SNAKE_CASE			:List[str]     ,						SCREAMING_SNAKE_CASE			:str     ,						SCREAMING_SNAKE_CASE			:Union[str, Any]     ,						SCREAMING_SNAKE_CASE			:Optional[Any]	)       ->					Tuple:




             '''simple docstring'''
             _a    : List[Any]     					=self.num_choices
             _a    : List[Any]     					=TFRoFormerForMultipleChoice(config=SCREAMING_SNAKE_CASE	)
             _a    : Optional[int]     					=tf.tile(tf.expand_dims(SCREAMING_SNAKE_CASE     ,						1	)     ,						(1, self.num_choices, 1)	)
             _a    : Any     					=tf.tile(tf.expand_dims(SCREAMING_SNAKE_CASE     ,						1	)     ,						(1, self.num_choices, 1)	)
             _a    : int     					=tf.tile(tf.expand_dims(SCREAMING_SNAKE_CASE     ,						1	)     ,						(1, self.num_choices, 1)	)
             _a    : List[str]     					={
                 """input_ids""": multiple_choice_inputs_ids,
                 """attention_mask""": multiple_choice_input_mask,
                 """token_type_ids""": multiple_choice_token_type_ids,
             }
             _a    : List[str]     					=model(SCREAMING_SNAKE_CASE	)
             self.parent.assertEqual(result.logits.shape     ,						(self.batch_size, self.num_choices)	)






      def __UpperCAmelCase       ( self			:Optional[int]     ,						SCREAMING_SNAKE_CASE			:str     ,						SCREAMING_SNAKE_CASE			:int     ,						SCREAMING_SNAKE_CASE			:str     ,						SCREAMING_SNAKE_CASE			:int     ,						SCREAMING_SNAKE_CASE			:List[str]     ,						SCREAMING_SNAKE_CASE			:Any     ,						SCREAMING_SNAKE_CASE			:Optional[Any]	)       ->					Optional[int]:




             '''simple docstring'''
             _a    : Any     					=self.num_labels
             _a    : Tuple     					=TFRoFormerForTokenClassification(config=SCREAMING_SNAKE_CASE	)
             _a    : Tuple     					={
                 """input_ids""": input_ids,
                 """attention_mask""": input_mask,
                 """token_type_ids""": token_type_ids,
             }
             _a    : Union[str, Any]     					=model(SCREAMING_SNAKE_CASE	)
             self.parent.assertEqual(result.logits.shape     ,						(self.batch_size, self.seq_length, self.num_labels)	)






      def __UpperCAmelCase       ( self			:Optional[Any]     ,						SCREAMING_SNAKE_CASE			:Optional[Any]     ,						SCREAMING_SNAKE_CASE			:List[str]     ,						SCREAMING_SNAKE_CASE			:Optional[int]     ,						SCREAMING_SNAKE_CASE			:List[str]     ,						SCREAMING_SNAKE_CASE			:Optional[Any]     ,						SCREAMING_SNAKE_CASE			:str     ,						SCREAMING_SNAKE_CASE			:List[Any]	)       ->					str:




             '''simple docstring'''
             _a    : int     					=TFRoFormerForQuestionAnswering(config=SCREAMING_SNAKE_CASE	)
             _a    : Dict     					={
                 """input_ids""": input_ids,
                 """attention_mask""": input_mask,
                 """token_type_ids""": token_type_ids,
             }

             _a    : Optional[int]     					=model(SCREAMING_SNAKE_CASE	)
             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			:Union[str, Any]	)       ->					Optional[Any]:




             '''simple docstring'''
             _a    : Dict     					=self.prepare_config_and_inputs()
             (
                 (
                 _a
             )					,    (
                 _a
             )					,    (
                 _a
             )					,    (
                 _a
             )					,    (
                 _a
             )					,    (
                 _a
             )					,    (
                 _a
             )					,    
             )    : Any     					=config_and_inputs
             _a    : List[Any]     					={"""input_ids""": input_ids, """token_type_ids""": token_type_ids, """attention_mask""": input_mask}
             return config, inputs_dict







@require_tf
class A__       (						UpperCAmelCase__ ,     UpperCAmelCase__ ,     unittest.TestCase      ):
      __UpperCamelCase       :  Optional[Any]	       =							(
          (
              TFRoFormerModel,
              TFRoFormerForCausalLM,
              TFRoFormerForMaskedLM,
              TFRoFormerForQuestionAnswering,
              TFRoFormerForSequenceClassification,
              TFRoFormerForTokenClassification,
              TFRoFormerForMultipleChoice,
          )
          if is_tf_available()
          else ()
      )
      __UpperCamelCase       :  List[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 {}
      )

      __UpperCamelCase       :  Optional[int]	       =							False
      __UpperCamelCase       :  str	       =							False






      def __UpperCAmelCase       ( self			:Optional[Any]     ,						SCREAMING_SNAKE_CASE			:Tuple     ,						SCREAMING_SNAKE_CASE			:str     ,						SCREAMING_SNAKE_CASE			:Dict     ,						SCREAMING_SNAKE_CASE			:Optional[int]     ,						SCREAMING_SNAKE_CASE			:List[Any]	)       ->					Dict:




             '''simple docstring'''
             if pipeline_test_casse_name == "TextGenerationPipelineTests":
                    return True

             return False






      def __UpperCAmelCase       ( self			:List[str]	)       ->					List[str]:




             '''simple docstring'''
             _a    : Dict     					=TFRoFormerModelTester(self	)
             _a    : Any     					=ConfigTester(self     ,						config_class=SCREAMING_SNAKE_CASE     ,						hidden_size=3_7	)






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




             '''simple docstring'''
             self.config_tester.run_common_tests()






      def __UpperCAmelCase       ( self			:Union[str, Any]	)       ->					Tuple:




             '''simple docstring'''
             _a    : Optional[Any]     					=self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_model(*SCREAMING_SNAKE_CASE	)






      def __UpperCAmelCase       ( self			:Any	)       ->					Dict:




             '''simple docstring'''
             _a    : Dict     					=self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_for_masked_lm(*SCREAMING_SNAKE_CASE	)






      def __UpperCAmelCase       ( self			:List[str]	)       ->					str:




             '''simple docstring'''
             _a    : Dict     					=self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_lm_head(*SCREAMING_SNAKE_CASE	)






      def __UpperCAmelCase       ( self			:Optional[Any]	)       ->					int:




             '''simple docstring'''
             _a    : Optional[Any]     					=self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_for_multiple_choice(*SCREAMING_SNAKE_CASE	)






      def __UpperCAmelCase       ( self			:List[Any]	)       ->					Dict:




             '''simple docstring'''
             _a    : Optional[int]     					=self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_for_question_answering(*SCREAMING_SNAKE_CASE	)






      def __UpperCAmelCase       ( self			:str	)       ->					Dict:




             '''simple docstring'''
             _a    : str     					=self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_for_sequence_classification(*SCREAMING_SNAKE_CASE	)






      def __UpperCAmelCase       ( self			:List[Any]	)       ->					Tuple:




             '''simple docstring'''
             _a    : List[Any]     					=self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_for_token_classification(*SCREAMING_SNAKE_CASE	)






      @slow
      def __UpperCAmelCase       ( self			:List[str]	)       ->					Dict:




             '''simple docstring'''
             _a    : str     					=TFRoFormerModel.from_pretrained("""junnyu/roformer_chinese_base"""	)
             self.assertIsNotNone(SCREAMING_SNAKE_CASE	)







@require_tf
class A__       (						unittest.TestCase      ):






      @slow
      def __UpperCAmelCase       ( self			:int	)       ->					Optional[int]:




             '''simple docstring'''
             _a    : Any     					=TFRoFormerForMaskedLM.from_pretrained("""junnyu/roformer_chinese_base"""	)
             _a    : Union[str, Any]     					=tf.constant([[0, 1, 2, 3, 4, 5]]	)
             _a    : Optional[Any]     					=model(SCREAMING_SNAKE_CASE	)[0]

             # TODO Replace vocab size
             _a    : Tuple     					=5_0_0_0_0

             _a    : Optional[int]     					=[1, 6, vocab_size]
             self.assertEqual(output.shape     ,						SCREAMING_SNAKE_CASE	)

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

             # TODO Replace values below with what was printed above.
             _a    : Dict     					=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]     ,						SCREAMING_SNAKE_CASE     ,						atol=1e-4	)







@require_tf
class A__       (						unittest.TestCase      ):
      __UpperCamelCase       :  Optional[int]	       =							1e-4






      def __UpperCAmelCase       ( self			:Optional[Any]	)       ->					str:




             '''simple docstring'''
             _a    : Optional[int]     					=tf.constant([[4, 1_0]]	)
             _a    : int     					=TFRoFormerSinusoidalPositionalEmbedding(num_positions=6     ,						embedding_dim=6	)

             _a    : Optional[Any]     					=emba(input_ids.shape	)
             _a    : Union[str, Any]     					=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(SCREAMING_SNAKE_CASE     ,						SCREAMING_SNAKE_CASE     ,						atol=self.tolerance	)






      def __UpperCAmelCase       ( self			:Union[str, Any]	)       ->					Union[str, Any]:




             '''simple docstring'''
             _a    : Optional[int]     					=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],
                 ]	)
             _a    : Tuple     					=TFRoFormerSinusoidalPositionalEmbedding(num_positions=5_1_2     ,						embedding_dim=5_1_2	)
             emba([2, 1_6, 5_1_2]	)
             _a    : Union[str, Any]     					=emba.weight[:3, :5]

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







@require_tf
class A__       (						unittest.TestCase      ):
      __UpperCamelCase       :  Tuple	       =							1e-4






      def __UpperCAmelCase       ( self			:str	)       ->					Union[str, Any]:




             '''simple docstring'''
             # 2,12,16,64
             _a    : Optional[int]     					=tf.reshape(tf.range(2 * 1_2 * 1_6 * 6_4     ,						dtype=tf.floataa	)     ,						shape=(2, 1_2, 1_6, 6_4)	) / 1_0_0

             _a    : int     					=-tf.reshape(tf.range(2 * 1_2 * 1_6 * 6_4     ,						dtype=tf.floataa	)     ,						shape=(2, 1_2, 1_6, 6_4)	) / 1_0_0

             _a    : List[str]     					=TFRoFormerSinusoidalPositionalEmbedding(num_positions=3_2     ,						embedding_dim=6_4	)
             _a    : List[Any]     					=embed_positions([2, 1_6, 7_6_8]	)[None, None, :, :]

             _a					,    _a    : Dict     					=TFRoFormerSelfAttention.apply_rotary_position_embeddings(
                 SCREAMING_SNAKE_CASE     ,						SCREAMING_SNAKE_CASE     ,						SCREAMING_SNAKE_CASE	)

             _a    : Any     					=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],
                 ]	)
             _a    : 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]     ,						SCREAMING_SNAKE_CASE     ,						atol=self.tolerance	)
             tf.debugging.assert_near(key_layer[0, 0, :6, :8]     ,						SCREAMING_SNAKE_CASE     ,						atol=self.tolerance	)






'''simple docstring'''







# NOTE: This file is deprecated and will be removed in a future version.
# It only exists so that temporarely `from diffusers.pipelines import DiffusionPipeline` works
from ...utils import deprecate
from ..controlnet.multicontrolnet import MultiControlNetModel  # noqa: F401
from ..controlnet.pipeline_controlnet import StableDiffusionControlNetPipeline  # noqa: F401


deprecate(
    '''stable diffusion controlnet''',
    '''0.22.0''',
    '''Importing `StableDiffusionControlNetPipeline` or `MultiControlNetModel` from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_controlnet is deprecated. Please import `from diffusers import StableDiffusionControlNetPipeline` instead.''',
    standard_warn=False,
    stacklevel=3,
)


