import json
import os
import unittest

from transformers import BatchEncoding, MvpTokenizer, MvpTokenizerFast
from transformers.models.roberta.tokenization_roberta import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers, require_torch
from transformers.utils import cached_property

from ...test_tokenization_common import TokenizerTesterMixin, filter_roberta_detectors


@require_tokenizers
class   lowercase      (       a			,    unittest.TestCase       ):
							lowercase__  :    Any									=							MvpTokenizer
							lowercase__  :    Union[str, Any]									=							MvpTokenizerFast
							lowercase__  :    Any									=							True
							lowercase__  :    Any									=							filter_roberta_detectors




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



												'''simple docstring'''

												super().setUp()
												SCREAMING_SNAKE_CASE           =    [
												    "l",
												    "o",
												    "w",
												    "e",
												    "r",
												    "s",
												    "t",
												    "i",
												    "d",
												    "n",
												    "\u0120",
												    "\u0120l",
												    "\u0120n",
												    "\u0120lo",
												    "\u0120low",
												    "er",
												    "\u0120lowest",
												    "\u0120newer",
												    "\u0120wider",
												    "<unk>",
												]
												SCREAMING_SNAKE_CASE           =    dict(zip(_UpperCamelCase		,							range(len(_UpperCamelCase ) ) ) )
												SCREAMING_SNAKE_CASE           =    ["#version: 0.2", "\u0120 l", "\u0120l o", "\u0120lo w", "e r", ""]
												SCREAMING_SNAKE_CASE           =    {"unk_token": "<unk>"}

												SCREAMING_SNAKE_CASE           =    os.path.join(self.tmpdirname		,							VOCAB_FILES_NAMES["vocab_file"] )
												SCREAMING_SNAKE_CASE           =    os.path.join(self.tmpdirname		,							VOCAB_FILES_NAMES["merges_file"] )
												with open(self.vocab_file		,							"w"		,							encoding="utf-8" ) as fp:
																	fp.write(json.dumps(_UpperCamelCase ) + "\n" )
												with open(self.merges_file		,							"w"		,							encoding="utf-8" ) as fp:
																	fp.write("\n".join(_UpperCamelCase ) )




							def 		__snake_case(  self				:   Tuple		,							**_UpperCamelCase				:   Any )   ->			Any:



												'''simple docstring'''

												kwargs.update(self.special_tokens_map )
												return self.tokenizer_class.from_pretrained(self.tmpdirname		,							**_UpperCamelCase )




							def 		__snake_case(  self				:   str		,							**_UpperCamelCase				:   Any )   ->			Dict:



												'''simple docstring'''

												kwargs.update(self.special_tokens_map )
												return self.rust_tokenizer_class.from_pretrained(self.tmpdirname		,							**_UpperCamelCase )




							def 		__snake_case(  self				:   List[str]		,							_UpperCamelCase				:   Optional[Any] )   ->			Optional[Any]:



												'''simple docstring'''

												return "lower newer", "lower newer"




							@cached_property
							def 		__snake_case(  self				:   Dict )   ->			Union[str, Any]:



												'''simple docstring'''

												return MvpTokenizer.from_pretrained("RUCAIBox/mvp" )




							@cached_property
							def 		__snake_case(  self				:   Any )   ->			List[str]:



												'''simple docstring'''

												return MvpTokenizerFast.from_pretrained("RUCAIBox/mvp" )




							@require_torch
							def 		__snake_case(  self				:   Dict )   ->			int:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    ["A long paragraph for summarization.", "Another paragraph for summarization."]
												SCREAMING_SNAKE_CASE           =    [0, 250, 251, 17_818, 13, 39_186, 1_938, 4, 2]

												for tokenizer in [self.default_tokenizer, self.default_tokenizer_fast]:
																	SCREAMING_SNAKE_CASE           =    tokenizer(_UpperCamelCase		,							max_length=len(_UpperCamelCase )		,							padding=_UpperCamelCase		,							return_tensors="pt" )
																	self.assertIsInstance(_UpperCamelCase		,							_UpperCamelCase )

																	self.assertEqual((2, 9)		,							batch.input_ids.shape )
																	self.assertEqual((2, 9)		,							batch.attention_mask.shape )
																	SCREAMING_SNAKE_CASE           =    batch.input_ids.tolist()[0]
																	self.assertListEqual(_UpperCamelCase		,							_UpperCamelCase )
																	# Test that special tokens are reset




							@require_torch
							def 		__snake_case(  self				:   Any )   ->			Union[str, Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    ["A long paragraph for summarization.", "Another paragraph for summarization."]
												for tokenizer in [self.default_tokenizer, self.default_tokenizer_fast]:
																	SCREAMING_SNAKE_CASE           =    tokenizer(_UpperCamelCase		,							padding=_UpperCamelCase		,							return_tensors="pt" )
																	# check if input_ids are returned and no labels
																	self.assertIn("input_ids"		,							_UpperCamelCase )
																	self.assertIn("attention_mask"		,							_UpperCamelCase )
																	self.assertNotIn("labels"		,							_UpperCamelCase )
																	self.assertNotIn("decoder_attention_mask"		,							_UpperCamelCase )




							@require_torch
							def 		__snake_case(  self				:   List[str] )   ->			Optional[Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    [
												    "Summary of the text.",
												    "Another summary.",
												]
												for tokenizer in [self.default_tokenizer, self.default_tokenizer_fast]:
																	SCREAMING_SNAKE_CASE           =    tokenizer(text_target=_UpperCamelCase		,							max_length=32		,							padding="max_length"		,							return_tensors="pt" )
																	self.assertEqual(32		,							targets["input_ids"].shape[1] )




							@require_torch
							def 		__snake_case(  self				:   Any )   ->			List[Any]:



												'''simple docstring'''

												for tokenizer in [self.default_tokenizer, self.default_tokenizer_fast]:
																	SCREAMING_SNAKE_CASE           =    tokenizer(
																	    ["I am a small frog" * 1_024, "I am a small frog"]		,							padding=_UpperCamelCase		,							truncation=_UpperCamelCase		,							return_tensors="pt" )
																	self.assertIsInstance(_UpperCamelCase		,							_UpperCamelCase )
																	self.assertEqual(batch.input_ids.shape		,							(2, 1_024) )




							@require_torch
							def 		__snake_case(  self				:   Optional[int] )   ->			Tuple:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    ["A long paragraph for summarization."]
												SCREAMING_SNAKE_CASE           =    [
												    "Summary of the text.",
												]
												for tokenizer in [self.default_tokenizer, self.default_tokenizer_fast]:
																	SCREAMING_SNAKE_CASE           =    tokenizer(_UpperCamelCase		,							text_target=_UpperCamelCase		,							return_tensors="pt" )
																	SCREAMING_SNAKE_CASE           =    inputs["input_ids"]
																	SCREAMING_SNAKE_CASE           =    inputs["labels"]
																	self.assertTrue((input_ids[:, 0] == tokenizer.bos_token_id).all().item() )
																	self.assertTrue((labels[:, 0] == tokenizer.bos_token_id).all().item() )
																	self.assertTrue((input_ids[:, -1] == tokenizer.eos_token_id).all().item() )
																	self.assertTrue((labels[:, -1] == tokenizer.eos_token_id).all().item() )




							def 		__snake_case(  self				:   int )   ->			Tuple:



												'''simple docstring'''

												pass





							def 		__snake_case(  self				:   Optional[int] )   ->			Optional[int]:



												'''simple docstring'''

												for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
																	with self.subTest(F"{tokenizer.__class__.__name__} ({pretrained_name})" ):
																						SCREAMING_SNAKE_CASE           =    self.rust_tokenizer_class.from_pretrained(_UpperCamelCase		,							**_UpperCamelCase )
																						SCREAMING_SNAKE_CASE           =    self.tokenizer_class.from_pretrained(_UpperCamelCase		,							**_UpperCamelCase )
																						SCREAMING_SNAKE_CASE           =    "A, <mask> AllenNLP sentence."
																						SCREAMING_SNAKE_CASE           =    tokenizer_r.encode_plus(_UpperCamelCase		,							add_special_tokens=_UpperCamelCase		,							return_token_type_ids=_UpperCamelCase )
																						SCREAMING_SNAKE_CASE           =    tokenizer_p.encode_plus(_UpperCamelCase		,							add_special_tokens=_UpperCamelCase		,							return_token_type_ids=_UpperCamelCase )

																						# token_type_ids should put 0 everywhere
																						self.assertEqual(sum(tokens_r["token_type_ids"] )		,							sum(tokens_p["token_type_ids"] ) )

																						# attention_mask should put 1 everywhere, so sum over length should be 1
																						self.assertEqual(
																						    sum(tokens_r["attention_mask"] ) / len(tokens_r["attention_mask"] )		,							sum(tokens_p["attention_mask"] ) / len(tokens_p["attention_mask"] )		,							)

																						SCREAMING_SNAKE_CASE           =    tokenizer_r.convert_ids_to_tokens(tokens_r["input_ids"] )
																						SCREAMING_SNAKE_CASE           =    tokenizer_p.convert_ids_to_tokens(tokens_p["input_ids"] )

																						# Rust correctly handles the space before the mask while python doesnt
																						self.assertSequenceEqual(tokens_p["input_ids"]		,							[0, 250, 6, 50_264, 3_823, 487, 21_992, 3_645, 4, 2] )
																						self.assertSequenceEqual(tokens_r["input_ids"]		,							[0, 250, 6, 50_264, 3_823, 487, 21_992, 3_645, 4, 2] )

																						self.assertSequenceEqual(
																						    _UpperCamelCase		,							["<s>", "A", ",", "<mask>", "ĠAllen", "N", "LP", "Ġsentence", ".", "</s>"] )
																						self.assertSequenceEqual(
																						    _UpperCamelCase		,							["<s>", "A", ",", "<mask>", "ĠAllen", "N", "LP", "Ġsentence", ".", "</s>"] )





import tempfile

import torch

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

from .test_schedulers import SchedulerCommonTest


class   lowercase      (       a       ):
							lowercase__  :    Dict									=							(UniPCMultistepScheduler,)
							lowercase__  :    Optional[int]									=							(("""num_inference_steps""", 25),)




							def 		__snake_case(  self				:   List[str]		,							**_UpperCamelCase				:   Tuple )   ->			Union[str, Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    {
												    "num_train_timesteps": 1_000,
												    "beta_start": 0.0_0_0_1,
												    "beta_end": 0.0_2,
												    "beta_schedule": "linear",
												    "solver_order": 2,
												    "solver_type": "bh2",
												}

												config.update(**_UpperCamelCase )
												return config




							def 		__snake_case(  self				:   List[str]		,							_UpperCamelCase				:   Dict=0		,							**_UpperCamelCase				:   List[str] )   ->			Any:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    dict(self.forward_default_kwargs )
												SCREAMING_SNAKE_CASE           =    kwargs.pop("num_inference_steps"		,							_UpperCamelCase )
												SCREAMING_SNAKE_CASE           =    self.dummy_sample
												SCREAMING_SNAKE_CASE           =    0.1 * sample
												SCREAMING_SNAKE_CASE           =    [residual + 0.2, residual + 0.1_5, residual + 0.1_0]

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

																	with tempfile.TemporaryDirectory() as tmpdirname:
																						scheduler.save_config(_UpperCamelCase )
																						SCREAMING_SNAKE_CASE           =    scheduler_class.from_pretrained(_UpperCamelCase )
																						new_scheduler.set_timesteps(_UpperCamelCase )
																						# copy over dummy past residuals
																						SCREAMING_SNAKE_CASE           =    dummy_past_residuals[: new_scheduler.config.solver_order]

																	SCREAMING_SNAKE_CASE     ,				SCREAMING_SNAKE_CASE           =    sample, sample
																	for t in range(_UpperCamelCase		,							time_step + scheduler.config.solver_order + 1 ):
																						SCREAMING_SNAKE_CASE           =    scheduler.step(_UpperCamelCase		,							_UpperCamelCase		,							_UpperCamelCase		,							**_UpperCamelCase ).prev_sample
																						SCREAMING_SNAKE_CASE           =    new_scheduler.step(_UpperCamelCase		,							_UpperCamelCase		,							_UpperCamelCase		,							**_UpperCamelCase ).prev_sample

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




							def 		__snake_case(  self				:   Any		,							_UpperCamelCase				:   Union[str, Any]=0		,							**_UpperCamelCase				:   Dict )   ->			Union[str, Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    dict(self.forward_default_kwargs )
												SCREAMING_SNAKE_CASE           =    kwargs.pop("num_inference_steps"		,							_UpperCamelCase )
												SCREAMING_SNAKE_CASE           =    self.dummy_sample
												SCREAMING_SNAKE_CASE           =    0.1 * sample
												SCREAMING_SNAKE_CASE           =    [residual + 0.2, residual + 0.1_5, residual + 0.1_0]

												for scheduler_class in self.scheduler_classes:
																	SCREAMING_SNAKE_CASE           =    self.get_scheduler_config()
																	SCREAMING_SNAKE_CASE           =    scheduler_class(**_UpperCamelCase )
																	scheduler.set_timesteps(_UpperCamelCase )

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

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

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

																	SCREAMING_SNAKE_CASE           =    scheduler.step(_UpperCamelCase		,							_UpperCamelCase		,							_UpperCamelCase		,							**_UpperCamelCase ).prev_sample
																	SCREAMING_SNAKE_CASE           =    new_scheduler.step(_UpperCamelCase		,							_UpperCamelCase		,							_UpperCamelCase		,							**_UpperCamelCase ).prev_sample

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




							def 		__snake_case(  self				:   List[str]		,							_UpperCamelCase				:   Tuple=None		,							**_UpperCamelCase				:   List[Any] )   ->			str:



												'''simple docstring'''

												if scheduler is None:
																	SCREAMING_SNAKE_CASE           =    self.scheduler_classes[0]
																	SCREAMING_SNAKE_CASE           =    self.get_scheduler_config(**_UpperCamelCase )
																	SCREAMING_SNAKE_CASE           =    scheduler_class(**_UpperCamelCase )

												SCREAMING_SNAKE_CASE           =    self.scheduler_classes[0]
												SCREAMING_SNAKE_CASE           =    self.get_scheduler_config(**_UpperCamelCase )
												SCREAMING_SNAKE_CASE           =    scheduler_class(**_UpperCamelCase )

												SCREAMING_SNAKE_CASE           =    10
												SCREAMING_SNAKE_CASE           =    self.dummy_model()
												SCREAMING_SNAKE_CASE           =    self.dummy_sample_deter
												scheduler.set_timesteps(_UpperCamelCase )

												for i, t in enumerate(scheduler.timesteps ):
																	SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase		,							_UpperCamelCase )
																	SCREAMING_SNAKE_CASE           =    scheduler.step(_UpperCamelCase		,							_UpperCamelCase		,							_UpperCamelCase ).prev_sample

												return sample




							def 		__snake_case(  self				:   int )   ->			Optional[int]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    dict(self.forward_default_kwargs )

												SCREAMING_SNAKE_CASE           =    kwargs.pop("num_inference_steps"		,							_UpperCamelCase )

												for scheduler_class in self.scheduler_classes:
																	SCREAMING_SNAKE_CASE           =    self.get_scheduler_config()
																	SCREAMING_SNAKE_CASE           =    scheduler_class(**_UpperCamelCase )

																	SCREAMING_SNAKE_CASE           =    self.dummy_sample
																	SCREAMING_SNAKE_CASE           =    0.1 * sample

																	if num_inference_steps is not None and hasattr(_UpperCamelCase		,							"set_timesteps" ):
																						scheduler.set_timesteps(_UpperCamelCase )
																	elif num_inference_steps is not None and not hasattr(_UpperCamelCase		,							"set_timesteps" ):
																						SCREAMING_SNAKE_CASE           =    num_inference_steps

																	# copy over dummy past residuals (must be done after set_timesteps)
																	SCREAMING_SNAKE_CASE           =    [residual + 0.2, residual + 0.1_5, residual + 0.1_0]
																	SCREAMING_SNAKE_CASE           =    dummy_past_residuals[: scheduler.config.solver_order]

																	SCREAMING_SNAKE_CASE           =    scheduler.timesteps[5]
																	SCREAMING_SNAKE_CASE           =    scheduler.timesteps[6]

																	SCREAMING_SNAKE_CASE           =    scheduler.step(_UpperCamelCase		,							_UpperCamelCase		,							_UpperCamelCase		,							**_UpperCamelCase ).prev_sample
																	SCREAMING_SNAKE_CASE           =    scheduler.step(_UpperCamelCase		,							_UpperCamelCase		,							_UpperCamelCase		,							**_UpperCamelCase ).prev_sample

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




							def 		__snake_case(  self				:   str )   ->			Any:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    UniPCMultistepScheduler(**self.get_scheduler_config() )
												SCREAMING_SNAKE_CASE           =    self.full_loop(scheduler=_UpperCamelCase )
												SCREAMING_SNAKE_CASE           =    torch.mean(torch.abs(_UpperCamelCase ) )

												assert abs(result_mean.item() - 0.2_4_6_4 ) < 1e-3

												SCREAMING_SNAKE_CASE           =    DPMSolverSinglestepScheduler.from_config(scheduler.config )
												SCREAMING_SNAKE_CASE           =    DEISMultistepScheduler.from_config(scheduler.config )
												SCREAMING_SNAKE_CASE           =    DPMSolverMultistepScheduler.from_config(scheduler.config )
												SCREAMING_SNAKE_CASE           =    UniPCMultistepScheduler.from_config(scheduler.config )

												SCREAMING_SNAKE_CASE           =    self.full_loop(scheduler=_UpperCamelCase )
												SCREAMING_SNAKE_CASE           =    torch.mean(torch.abs(_UpperCamelCase ) )

												assert abs(result_mean.item() - 0.2_4_6_4 ) < 1e-3




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



												'''simple docstring'''

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




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



												'''simple docstring'''

												self.check_over_configs(thresholding=_UpperCamelCase )
												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=_UpperCamelCase		,							prediction_type=_UpperCamelCase		,							sample_max_value=_UpperCamelCase		,							solver_order=_UpperCamelCase		,							solver_type=_UpperCamelCase		,							)




							def 		__snake_case(  self				:   Tuple )   ->			int:



												'''simple docstring'''

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




							def 		__snake_case(  self				:   Dict )   ->			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=_UpperCamelCase		,							solver_type=_UpperCamelCase		,							prediction_type=_UpperCamelCase		,							)
																											SCREAMING_SNAKE_CASE           =    self.full_loop(
																											    solver_order=_UpperCamelCase		,							solver_type=_UpperCamelCase		,							prediction_type=_UpperCamelCase		,							)
																											assert not torch.isnan(_UpperCamelCase ).any(), "Samples have nan numbers"




							def 		__snake_case(  self				:   List[str] )   ->			Tuple:



												'''simple docstring'''

												self.check_over_configs(lower_order_final=_UpperCamelCase )
												self.check_over_configs(lower_order_final=_UpperCamelCase )




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



												'''simple docstring'''

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




							def 		__snake_case(  self				:   Tuple )   ->			Dict:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.full_loop()
												SCREAMING_SNAKE_CASE           =    torch.mean(torch.abs(_UpperCamelCase ) )

												assert abs(result_mean.item() - 0.2_4_6_4 ) < 1e-3




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



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.full_loop(prediction_type="v_prediction" )
												SCREAMING_SNAKE_CASE           =    torch.mean(torch.abs(_UpperCamelCase ) )

												assert abs(result_mean.item() - 0.1_0_1_4 ) < 1e-3




							def 		__snake_case(  self				:   int )   ->			Any:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.scheduler_classes[0]
												SCREAMING_SNAKE_CASE           =    self.get_scheduler_config(thresholding=_UpperCamelCase		,							dynamic_thresholding_ratio=0 )
												SCREAMING_SNAKE_CASE           =    scheduler_class(**_UpperCamelCase )

												SCREAMING_SNAKE_CASE           =    10
												SCREAMING_SNAKE_CASE           =    self.dummy_model()
												SCREAMING_SNAKE_CASE           =    self.dummy_sample_deter.half()
												scheduler.set_timesteps(_UpperCamelCase )

												for i, t in enumerate(scheduler.timesteps ):
																	SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase		,							_UpperCamelCase )
																	SCREAMING_SNAKE_CASE           =    scheduler.step(_UpperCamelCase		,							_UpperCamelCase		,							_UpperCamelCase ).prev_sample

												assert sample.dtype == torch.floataa





							def 		__snake_case(  self				:   List[str]		,							**_UpperCamelCase				:   Dict )   ->			Union[str, Any]:



												'''simple docstring'''

												for scheduler_class in self.scheduler_classes:
																	SCREAMING_SNAKE_CASE           =    self.get_scheduler_config(**_UpperCamelCase )
																	SCREAMING_SNAKE_CASE           =    scheduler_class(**_UpperCamelCase )

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




