





'''simple docstring'''


from __future__ import annotations

import inspect
import unittest
from typing import List, Tuple

from transformers import RegNetConfig
from transformers.testing_utils import require_tf, require_vision, slow
from transformers.utils import cached_property, is_tf_available, is_vision_available

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


if is_tf_available():
 import tensorflow as tf

 from transformers import TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFRegNetForImageClassification, TFRegNetModel


if is_vision_available():
 from PIL import Image

 from transformers import AutoImageProcessor
class 				a_       :





     def __init__(			self		: Optional[int]     ,				lowercase		: List[Any]     ,				lowercase		: List[Any]=3     ,				lowercase		: str=32     ,				lowercase		: int=3     ,				lowercase		: Dict=10     ,				lowercase		: Tuple=[10, 20, 30, 40]     ,				lowercase		: Optional[int]=[1, 1, 2, 1]     ,				lowercase		: str=True     ,				lowercase		: Union[str, Any]=True     ,				lowercase		: int="relu"     ,				lowercase		: Any=3     ,				lowercase		: int=None     ,				):





        """simple docstring"""




        lowercase_      :List[Any]         =			parent
        lowercase_      :List[str]         =			batch_size
        lowercase_      :List[str]         =			image_size
        lowercase_      :Optional[Any]         =			num_channels
        lowercase_      :int         =			embeddings_size
        lowercase_      :Any         =			hidden_sizes
        lowercase_      :str         =			depths
        lowercase_      :Union[str, Any]         =			is_training
        lowercase_      :Any         =			use_labels
        lowercase_      :Tuple         =			hidden_act
        lowercase_      :Optional[int]         =			num_labels
        lowercase_      :Union[str, Any]         =			scope
        lowercase_      :Dict         =			len(__snake_case						)





     def 							lowercase__				(			self		: Dict						):





        """simple docstring"""




        lowercase_      :int         =			floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]						)

        lowercase_      :Optional[Any]         =			None
        if self.use_labels:
           lowercase_      :Tuple         =			ids_tensor([self.batch_size]     ,				self.num_labels						)

        lowercase_      :Dict         =			self.get_config()
        return config, pixel_values, labels





     def 							lowercase__				(			self		: Tuple						):





        """simple docstring"""




        return RegNetConfig(
            num_channels=self.num_channels     ,				embeddings_size=self.embeddings_size     ,				hidden_sizes=self.hidden_sizes     ,				depths=self.depths     ,				hidden_act=self.hidden_act     ,				num_labels=self.num_labels     ,				)





     def 							lowercase__				(			self		: Dict     ,				lowercase		: Dict     ,				lowercase		: Any     ,				lowercase		: Tuple						):





        """simple docstring"""




        lowercase_      :Dict         =			TFRegNetModel(config=__snake_case						)
        lowercase_      :Optional[int]         =			model(__snake_case     ,				training=__snake_case						)
        # expected last hidden states: B, C, H // 32, W // 32
        self.parent.assertEqual(
            result.last_hidden_state.shape     ,				(self.batch_size, self.hidden_sizes[-1], self.image_size // 32, self.image_size // 32)     ,				)





     def 							lowercase__				(			self		: Dict     ,				lowercase		: Union[str, Any]     ,				lowercase		: int     ,				lowercase		: Tuple						):





        """simple docstring"""




        lowercase_      :Optional[Any]         =			self.num_labels
        lowercase_      :List[Any]         =			TFRegNetForImageClassification(__snake_case						)
        lowercase_      :int         =			model(__snake_case     ,				labels=__snake_case     ,				training=__snake_case						)
        self.parent.assertEqual(result.logits.shape     ,				(self.batch_size, self.num_labels)						)







     def 							lowercase__				(			self		: Union[str, Any]						):





        """simple docstring"""




        lowercase_      :int         =			self.prepare_config_and_inputs()
        lowercase_      :List[str]         =			config_and_inputs
        lowercase_      :Tuple         =			{'pixel_values': pixel_values}
        return config, inputs_dict







@require_tf
class 				a_       (    lowerCamelCase__     ,						lowerCamelCase__     ,						unittest.TestCase							):
     __A								=      (TFRegNetModel, TFRegNetForImageClassification) if is_tf_available() else ()
     __A								=      (
         {"feature-extraction": TFRegNetModel, "image-classification": TFRegNetForImageClassification}
         if is_tf_available()
         else {}
     )

     __A								=      False
     __A								=      False
     __A								=      False
     __A								=      False
     __A								=      False





     def 							lowercase__				(			self		: Optional[int]						):





        """simple docstring"""




        lowercase_      :Optional[int]         =			TFRegNetModelTester(self						)
        lowercase_      :List[Any]         =			ConfigTester(self     ,				config_class=__snake_case     ,				has_text_modality=__snake_case						)





     def 							lowercase__				(			self		: Tuple						):





        """simple docstring"""




        return





     @unittest.skip(reason="RegNet does not use inputs_embeds"						)
     def 							lowercase__				(			self		: Dict						):





        """simple docstring"""




        pass





     @unittest.skipIf(
         not is_tf_available() or len(tf.config.list_physical_devices("GPU"						)						) == 0     ,				reason="TF does not support backprop for grouped convolutions on CPU."     ,				)
     @slow
     def 							lowercase__				(			self		: List[str]						):





        """simple docstring"""




        super().test_keras_fit()





     @unittest.skip(reason="RegNet does not support input and output embeddings"						)
     def 							lowercase__				(			self		: Tuple						):





        """simple docstring"""




        pass





     def 							lowercase__				(			self		: str						):





        """simple docstring"""




        lowercase_      :Optional[Any]         =			self.model_tester.prepare_config_and_inputs_for_common()

        for model_class in self.all_model_classes:
           lowercase_      :Tuple         =			model_class(__snake_case						)
           lowercase_      :Dict         =			inspect.signature(model.call						)
           # signature.parameters is an OrderedDict => so arg_names order is deterministic
           lowercase_      :Optional[Any]         =			[*signature.parameters.keys()]

           lowercase_      :List[Any]         =			['pixel_values']
           self.assertListEqual(arg_names[:1]     ,				__snake_case						)





     def 							lowercase__				(			self		: str						):





        """simple docstring"""




        lowercase_      :Optional[int]         =			self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_model(*__snake_case						)





     def 							lowercase__				(			self		: Tuple						):





        """simple docstring"""




        def check_hidden_states_output(lowercase		: Union[str, Any]     ,				lowercase		: List[str]     ,				lowercase		: Any						):
           lowercase_      :Any         =			model_class(__snake_case						)
           lowercase_      :Any         =			model(**self._prepare_for_class(__snake_case     ,				__snake_case						)     ,				training=__snake_case						)

           lowercase_      :Dict         =			outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

           lowercase_      :Any         =			self.model_tester.num_stages
           self.assertEqual(len(__snake_case						)     ,				expected_num_stages + 1						)

           # RegNet's feature maps are of shape (batch_size, num_channels, height, width)
           self.assertListEqual(
               list(hidden_states[0].shape[-2:]						)     ,				[self.model_tester.image_size // 2, self.model_tester.image_size // 2]     ,				)

        lowercase_      :List[Any]         =			self.model_tester.prepare_config_and_inputs_for_common()
        lowercase_      :Union[str, Any]         =			['basic', 'bottleneck']
        for model_class in self.all_model_classes:
           for layer_type in layers_type:
              lowercase_      :Dict         =			layer_type
              lowercase_      :Any         =			True
              check_hidden_states_output(__snake_case     ,				__snake_case     ,				__snake_case						)

              # check that output_hidden_states also work using config
              del inputs_dict["output_hidden_states"]
              lowercase_      :Any         =			True

              check_hidden_states_output(__snake_case     ,				__snake_case     ,				__snake_case						)





     def 							lowercase__				(			self		: str						):





        """simple docstring"""




        lowercase_      :Any         =			self.model_tester.prepare_config_and_inputs_for_common()

        def check_equivalence(lowercase		: Tuple     ,				lowercase		: int     ,				lowercase		: Dict     ,				lowercase		: Tuple={}						):
           lowercase_      :Optional[int]         =			model(__snake_case     ,				return_dict=__snake_case     ,				**__snake_case						)
           lowercase_      :List[Any]         =			model(__snake_case     ,				return_dict=__snake_case     ,				**__snake_case						).to_tuple()

           def recursive_check(lowercase		: Dict     ,				lowercase		: Tuple						):
              if isinstance(__snake_case     ,				(List, Tuple)						):
                 for tuple_iterable_value, dict_iterable_value in zip(__snake_case     ,				__snake_case						):
                    recursive_check(__snake_case     ,				__snake_case						)
              elif tuple_object is None:
                 return
              else:
                 self.assertTrue(
                     all(tf.equal(__snake_case     ,				__snake_case						)						)     ,				msg=(
                         "Tuple and dict output are not equal. Difference:"
                         F' {tf.math.reduce_max(tf.abs(tuple_object - dict_object						)						)}'
                     )     ,				)

              recursive_check(__snake_case     ,				__snake_case						)

        for model_class in self.all_model_classes:
           lowercase_      :str         =			model_class(__snake_case						)

           lowercase_      :Any         =			self._prepare_for_class(__snake_case     ,				__snake_case						)
           lowercase_      :int         =			self._prepare_for_class(__snake_case     ,				__snake_case						)
           check_equivalence(__snake_case     ,				__snake_case     ,				__snake_case						)

           lowercase_      :Optional[Any]         =			self._prepare_for_class(__snake_case     ,				__snake_case     ,				return_labels=__snake_case						)
           lowercase_      :Optional[int]         =			self._prepare_for_class(__snake_case     ,				__snake_case     ,				return_labels=__snake_case						)
           check_equivalence(__snake_case     ,				__snake_case     ,				__snake_case						)

           lowercase_      :Dict         =			self._prepare_for_class(__snake_case     ,				__snake_case						)
           lowercase_      :int         =			self._prepare_for_class(__snake_case     ,				__snake_case						)
           check_equivalence(__snake_case     ,				__snake_case     ,				__snake_case     ,				{"output_hidden_states": True}						)

           lowercase_      :List[Any]         =			self._prepare_for_class(__snake_case     ,				__snake_case     ,				return_labels=__snake_case						)
           lowercase_      :List[Any]         =			self._prepare_for_class(__snake_case     ,				__snake_case     ,				return_labels=__snake_case						)
           check_equivalence(__snake_case     ,				__snake_case     ,				__snake_case     ,				{"output_hidden_states": True}						)





     def 							lowercase__				(			self		: Dict						):





        """simple docstring"""




        lowercase_      :Optional[int]         =			self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_image_classification(*__snake_case						)







     @slow
     def 							lowercase__				(			self		: Any						):





        """simple docstring"""




        for model_name in TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
           lowercase_      :Any         =			TFRegNetModel.from_pretrained(__snake_case						)
           self.assertIsNotNone(__snake_case						)







def 							UpperCAmelCase_  (						):
   lowercase_      :List[Any]         =			Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"			)
   return image


@require_tf
@require_vision
class 				a_       (    unittest.TestCase							):





     @cached_property
     def 							lowercase__				(			self		: Optional[Any]						):





        """simple docstring"""




        return (
            AutoImageProcessor.from_pretrained(TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]						)
            if is_vision_available()
            else None
        )







     @slow
     def 							lowercase__				(			self		: List[str]						):





        """simple docstring"""




        lowercase_      :Optional[Any]         =			TFRegNetForImageClassification.from_pretrained(TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]						)

        lowercase_      :Dict         =			self.default_image_processor
        lowercase_      :Tuple         =			prepare_img()
        lowercase_      :Any         =			image_processor(images=__snake_case     ,				return_tensors="tf"						)

        # forward pass
        lowercase_      :Tuple         =			model(**__snake_case     ,				training=__snake_case						)

        # verify the logits
        lowercase_      :Union[str, Any]         =			tf.TensorShape((1, 1_000)						)
        self.assertEqual(outputs.logits.shape     ,				__snake_case						)

        lowercase_      :List[str]         =			tf.constant([-0.41_80, -1.50_51, -3.48_36]						)

        tf.debugging.assert_near(outputs.logits[0, :3]     ,				__snake_case     ,				atol=1e-4						)









'''simple docstring'''


import tempfile

import torch

from diffusers import (
    DEISMultistepScheduler,
    DPMSolverMultistepScheduler,
    DPMSolverSinglestepScheduler,
    UniPCMultistepScheduler,
)

from .test_schedulers import SchedulerCommonTest
class 				a_       (    _lowerCAmelCase							):
     __A								=      (UniPCMultistepScheduler,)
     __A								=      (("num_inference_steps", 25),)





     def 							lowercase__				(			self		: Tuple     ,				**lowercase		: Optional[Any]						):





        """simple docstring"""




        lowercase_      :Any         =			{
            "num_train_timesteps": 1_000,
            "beta_start": 0.00_01,
            "beta_end": 0.02,
            "beta_schedule": "linear",
            "solver_order": 2,
            "solver_type": "bh2",
        }

        config.update(**lowercase						)
        return config





     def 							lowercase__				(			self		: Optional[Any]     ,				lowercase		: str=0     ,				**lowercase		: Union[str, Any]						):





        """simple docstring"""




        lowercase_      :Tuple         =			dict(self.forward_default_kwargs						)
        lowercase_      :Tuple         =			kwargs.pop("num_inference_steps"     ,				lowercase						)
        lowercase_      :Union[str, Any]         =			self.dummy_sample
        lowercase_      :Union[str, Any]         =			0.1 * sample
        lowercase_      :Any         =			[residual + 0.2, residual + 0.15, residual + 0.10]

        for scheduler_class in self.scheduler_classes:
           lowercase_      :Tuple         =			self.get_scheduler_config(**lowercase						)
           lowercase_      :Tuple         =			scheduler_class(**lowercase						)
           scheduler.set_timesteps(lowercase						)
           # copy over dummy past residuals
           lowercase_      :str         =			dummy_past_residuals[: scheduler.config.solver_order]

           with tempfile.TemporaryDirectory() as tmpdirname:
              scheduler.save_config(lowercase						)
              lowercase_      :str         =			scheduler_class.from_pretrained(lowercase						)
              new_scheduler.set_timesteps(lowercase						)
              # copy over dummy past residuals
              lowercase_      :List[Any]         =			dummy_past_residuals[: new_scheduler.config.solver_order]

           lowercase_      ,							lowercase_      :Tuple         =			sample, sample
           for t in range(lowercase     ,				time_step + scheduler.config.solver_order + 1						):
              lowercase_      :Optional[int]         =			scheduler.step(lowercase     ,				lowercase     ,				lowercase     ,				**lowercase						).prev_sample
              lowercase_      :Union[str, Any]         =			new_scheduler.step(lowercase     ,				lowercase     ,				lowercase     ,				**lowercase						).prev_sample

              assert torch.sum(torch.abs(output - new_output						)						) < 1e-5, "Scheduler outputs are not identical"





     def 							lowercase__				(			self		: str     ,				lowercase		: Any=0     ,				**lowercase		: str						):





        """simple docstring"""




        lowercase_      :Tuple         =			dict(self.forward_default_kwargs						)
        lowercase_      :Dict         =			kwargs.pop("num_inference_steps"     ,				lowercase						)
        lowercase_      :str         =			self.dummy_sample
        lowercase_      :Optional[int]         =			0.1 * sample
        lowercase_      :Optional[int]         =			[residual + 0.2, residual + 0.15, residual + 0.10]

        for scheduler_class in self.scheduler_classes:
           lowercase_      :Any         =			self.get_scheduler_config()
           lowercase_      :Tuple         =			scheduler_class(**lowercase						)
           scheduler.set_timesteps(lowercase						)

           # copy over dummy past residuals (must be after setting timesteps)
           lowercase_      :str         =			dummy_past_residuals[: scheduler.config.solver_order]

           with tempfile.TemporaryDirectory() as tmpdirname:
              scheduler.save_config(lowercase						)
              lowercase_      :int         =			scheduler_class.from_pretrained(lowercase						)
              # copy over dummy past residuals
              new_scheduler.set_timesteps(lowercase						)

              # copy over dummy past residual (must be after setting timesteps)
              lowercase_      :Optional[Any]         =			dummy_past_residuals[: new_scheduler.config.solver_order]

           lowercase_      :Dict         =			scheduler.step(lowercase     ,				lowercase     ,				lowercase     ,				**lowercase						).prev_sample
           lowercase_      :str         =			new_scheduler.step(lowercase     ,				lowercase     ,				lowercase     ,				**lowercase						).prev_sample

           assert torch.sum(torch.abs(output - new_output						)						) < 1e-5, "Scheduler outputs are not identical"





     def 							lowercase__				(			self		: List[str]     ,				lowercase		: Optional[int]=None     ,				**lowercase		: int						):





        """simple docstring"""




        if scheduler is None:
           lowercase_      :int         =			self.scheduler_classes[0]
           lowercase_      :Optional[Any]         =			self.get_scheduler_config(**lowercase						)
           lowercase_      :Optional[Any]         =			scheduler_class(**lowercase						)

        lowercase_      :str         =			self.scheduler_classes[0]
        lowercase_      :Optional[int]         =			self.get_scheduler_config(**lowercase						)
        lowercase_      :List[Any]         =			scheduler_class(**lowercase						)

        lowercase_      :str         =			10
        lowercase_      :List[str]         =			self.dummy_model()
        lowercase_      :Optional[int]         =			self.dummy_sample_deter
        scheduler.set_timesteps(lowercase						)

        for i, t in enumerate(scheduler.timesteps						):
           lowercase_      :int         =			model(lowercase     ,				lowercase						)
           lowercase_      :Dict         =			scheduler.step(lowercase     ,				lowercase     ,				lowercase						).prev_sample

        return sample





     def 							lowercase__				(			self		: int						):





        """simple docstring"""




        lowercase_      :str         =			dict(self.forward_default_kwargs						)

        lowercase_      :Union[str, Any]         =			kwargs.pop("num_inference_steps"     ,				lowercase						)

        for scheduler_class in self.scheduler_classes:
           lowercase_      :Optional[Any]         =			self.get_scheduler_config()
           lowercase_      :Optional[int]         =			scheduler_class(**lowercase						)

           lowercase_      :Union[str, Any]         =			self.dummy_sample
           lowercase_      :str         =			0.1 * sample

           if num_inference_steps is not None and hasattr(lowercase     ,				"set_timesteps"						):
              scheduler.set_timesteps(lowercase						)
           elif num_inference_steps is not None and not hasattr(lowercase     ,				"set_timesteps"						):
              lowercase_      :str         =			num_inference_steps

           # copy over dummy past residuals (must be done after set_timesteps)
           lowercase_      :Dict         =			[residual + 0.2, residual + 0.15, residual + 0.10]
           lowercase_      :Any         =			dummy_past_residuals[: scheduler.config.solver_order]

           lowercase_      :Optional[int]         =			scheduler.timesteps[5]
           lowercase_      :List[Any]         =			scheduler.timesteps[6]

           lowercase_      :Optional[Any]         =			scheduler.step(lowercase     ,				lowercase     ,				lowercase     ,				**lowercase						).prev_sample
           lowercase_      :List[str]         =			scheduler.step(lowercase     ,				lowercase     ,				lowercase     ,				**lowercase						).prev_sample

           self.assertEqual(output_a.shape     ,				sample.shape						)
           self.assertEqual(output_a.shape     ,				output_a.shape						)





     def 							lowercase__				(			self		: List[str]						):





        """simple docstring"""




        lowercase_      :List[Any]         =			UniPCMultistepScheduler(**self.get_scheduler_config()						)
        lowercase_      :Dict         =			self.full_loop(scheduler=lowercase						)
        lowercase_      :List[Any]         =			torch.mean(torch.abs(lowercase						)						)

        assert abs(result_mean.item() - 0.24_64						) < 1e-3

        lowercase_      :List[str]         =			DPMSolverSinglestepScheduler.from_config(scheduler.config						)
        lowercase_      :Tuple         =			DEISMultistepScheduler.from_config(scheduler.config						)
        lowercase_      :Optional[int]         =			DPMSolverMultistepScheduler.from_config(scheduler.config						)
        lowercase_      :Tuple         =			UniPCMultistepScheduler.from_config(scheduler.config						)

        lowercase_      :Tuple         =			self.full_loop(scheduler=lowercase						)
        lowercase_      :Tuple         =			torch.mean(torch.abs(lowercase						)						)

        assert abs(result_mean.item() - 0.24_64						) < 1e-3





     def 							lowercase__				(			self		: Tuple						):





        """simple docstring"""




        for timesteps in [25, 50, 100, 999, 1_000]:
           self.check_over_configs(num_train_timesteps=lowercase						)





     def 							lowercase__				(			self		: int						):





        """simple docstring"""




        self.check_over_configs(thresholding=lowercase						)
        for order in [1, 2, 3]:
           for solver_type in ["bh1", "bh2"]:
              for threshold in [0.5, 1.0, 2.0]:
                 for prediction_type in ["epsilon", "sample"]:
                    self.check_over_configs(
                        thresholding=lowercase     ,				prediction_type=lowercase     ,				sample_max_value=lowercase     ,				solver_order=lowercase     ,				solver_type=lowercase     ,				)





     def 							lowercase__				(			self		: List[str]						):





        """simple docstring"""




        for prediction_type in ["epsilon", "v_prediction"]:
           self.check_over_configs(prediction_type=lowercase						)





     def 							lowercase__				(			self		: Optional[int]						):





        """simple docstring"""




        for solver_type in ["bh1", "bh2"]:
           for order in [1, 2, 3]:
              for prediction_type in ["epsilon", "sample"]:
                 self.check_over_configs(
                     solver_order=lowercase     ,				solver_type=lowercase     ,				prediction_type=lowercase     ,				)
                 lowercase_      :Tuple         =			self.full_loop(
                     solver_order=lowercase     ,				solver_type=lowercase     ,				prediction_type=lowercase     ,				)
                 assert not torch.isnan(lowercase						).any(), "Samples have nan numbers"





     def 							lowercase__				(			self		: List[Any]						):





        """simple docstring"""




        self.check_over_configs(lower_order_final=lowercase						)
        self.check_over_configs(lower_order_final=lowercase						)





     def 							lowercase__				(			self		: Tuple						):





        """simple docstring"""




        for num_inference_steps in [1, 2, 3, 5, 10, 50, 100, 999, 1_000]:
           self.check_over_forward(num_inference_steps=lowercase     ,				time_step=0						)





     def 							lowercase__				(			self		: Dict						):





        """simple docstring"""




        lowercase_      :List[str]         =			self.full_loop()
        lowercase_      :List[str]         =			torch.mean(torch.abs(lowercase						)						)

        assert abs(result_mean.item() - 0.24_64						) < 1e-3





     def 							lowercase__				(			self		: Any						):





        """simple docstring"""




        lowercase_      :Dict         =			self.full_loop(prediction_type="v_prediction"						)
        lowercase_      :Any         =			torch.mean(torch.abs(lowercase						)						)

        assert abs(result_mean.item() - 0.10_14						) < 1e-3





     def 							lowercase__				(			self		: Optional[Any]						):





        """simple docstring"""




        lowercase_      :Union[str, Any]         =			self.scheduler_classes[0]
        lowercase_      :str         =			self.get_scheduler_config(thresholding=lowercase     ,				dynamic_thresholding_ratio=0						)
        lowercase_      :Tuple         =			scheduler_class(**lowercase						)

        lowercase_      :Optional[int]         =			10
        lowercase_      :Optional[int]         =			self.dummy_model()
        lowercase_      :Any         =			self.dummy_sample_deter.half()
        scheduler.set_timesteps(lowercase						)

        for i, t in enumerate(scheduler.timesteps						):
           lowercase_      :Tuple         =			model(lowercase     ,				lowercase						)
           lowercase_      :Any         =			scheduler.step(lowercase     ,				lowercase     ,				lowercase						).prev_sample

        assert sample.dtype == torch.floataa







     def 							lowercase__				(			self		: List[Any]     ,				**lowercase		: Union[str, Any]						):





        """simple docstring"""




        for scheduler_class in self.scheduler_classes:
           lowercase_      :Optional[int]         =			self.get_scheduler_config(**lowercase						)
           lowercase_      :Dict         =			scheduler_class(**lowercase						)

           scheduler.set_timesteps(scheduler.config.num_train_timesteps						)
           assert len(scheduler.timesteps.unique()						) == scheduler.num_inference_steps


