
import math
import warnings
from dataclasses import dataclass
from typing import List, Optional, Tuple, Union

import numpy as np
import torch
from scipy import integrate

from ..configuration_utils import ConfigMixin, register_to_config
from ..utils import BaseOutput
from .scheduling_utils import KarrasDiffusionSchedulers, SchedulerMixin







@dataclass
# Copied from diffusers.schedulers.scheduling_ddpm.DDPMSchedulerOutput with DDPM->LMSDiscrete
class 			UpperCamelCase__		(     SCREAMING_SNAKE_CASE_ ):







	'''simple docstring'''
	_lowerCAmelCase											=					42
	_lowerCAmelCase											=					None




def 					SCREAMING_SNAKE_CASE  (   __UpperCamelCase			:    Optional[int]				,    __UpperCamelCase			:    Dict=0.9_9_9				,    __UpperCamelCase			:    List[str]="cosine"				,    )			->							Union[str, Any]:

				"""simple docstring"""







				if alpha_transform_type == "cosine":

								def alpha_bar_fn(__UpperCamelCase			:    Any							):
												return math.cos((t + 0.0_0_8) / 1.0_0_8 * math.pi / 2							) ** 2

				elif alpha_transform_type == "exp":

								def alpha_bar_fn(__UpperCamelCase			:    Any							):
												return math.exp(t * -1_2.0							)

				else:
								raise ValueError(F"Unsupported alpha_tranform_type: {alpha_transform_type}"							)

				A__	:						List[str]								=				[]
				for i in range(__UpperCamelCase							):
								A__	:						str								=				i / num_diffusion_timesteps
								A__	:						List[Any]								=				(i + 1) / num_diffusion_timesteps
								betas.append(min(1 - alpha_bar_fn(__UpperCamelCase							) / alpha_bar_fn(__UpperCamelCase							)				,    __UpperCamelCase							)							)
				return torch.tensor(__UpperCamelCase				,    dtype=torch.floataa							)







class 			UpperCamelCase__		(     SCREAMING_SNAKE_CASE_,      SCREAMING_SNAKE_CASE_ ):







	'''simple docstring'''
	_lowerCAmelCase											=					[e.name for e in KarrasDiffusionSchedulers]
	_lowerCAmelCase											=					1





	@register_to_config
	def __init__(      self					,							UpperCamelCase__ = 1000					,							UpperCamelCase__ = 0.0_0_0_1					,							UpperCamelCase__ = 0.0_2					,							UpperCamelCase__ = "linear"					,							UpperCamelCase__ = None					,							UpperCamelCase__ = False					,							UpperCamelCase__ = "epsilon"					,							UpperCamelCase__ = "linspace"					,							UpperCamelCase__ = 0					,							):
					if trained_betas is not None:
									A__	:						Dict								=				torch.tensor(UpperCamelCase__					,							dtype=torch.floataa		)
					elif beta_schedule == "linear":
									A__	:						Tuple								=				torch.linspace(UpperCamelCase__					,							UpperCamelCase__					,							UpperCamelCase__					,							dtype=torch.floataa		)
					elif beta_schedule == "scaled_linear":
									# this schedule is very specific to the latent diffusion model.
									A__	:						List[str]								=				(
									    torch.linspace(beta_start**0.5					,							beta_end**0.5					,							UpperCamelCase__					,							dtype=torch.floataa		) ** 2
									)
					elif beta_schedule == "squaredcos_cap_v2":
									# Glide cosine schedule
									A__	:						Dict								=				betas_for_alpha_bar(UpperCamelCase__		)
					else:
									raise NotImplementedError(F"{beta_schedule} does is not implemented for {self.__class__}"		)

					A__	:						int								=				1.0 - self.betas
					A__	:						Optional[int]								=				torch.cumprod(self.alphas					,							dim=0		)

					A__	:						List[Any]								=				np.array(((1 - self.alphas_cumprod) / self.alphas_cumprod) ** 0.5		)
					A__	:						Any								=				np.concatenate([sigmas[::-1], [0.0]]		).astype(np.floataa		)
					A__	:						Union[str, Any]								=				torch.from_numpy(UpperCamelCase__		)

					# setable values
					A__	:						Optional[int]								=				None
					A__	:						Union[str, Any]								=				use_karras_sigmas
					self.set_timesteps(UpperCamelCase__					,							UpperCamelCase__		)
					A__	:						Any								=				[]
					A__	:						Any								=				False





	@property
	def 	__snake_case					(      self		):
					# standard deviation of the initial noise distribution
					if self.config.timestep_spacing in ["linspace", "trailing"]:
									return self.sigmas.max()

					return (self.sigmas.max() ** 2 + 1) ** 0.5





	def 	__snake_case					(      self					,							UpperCamelCase__					,							UpperCamelCase__		):
					if isinstance(UpperCamelCase__					,							torch.Tensor		):
									A__	:						Any								=				timestep.to(self.timesteps.device		)
					A__	:						Any								=				(self.timesteps == timestep).nonzero().item()
					A__	:						int								=				self.sigmas[step_index]
					A__	:						List[str]								=				sample / ((sigma**2 + 1) ** 0.5)
					A__	:						Tuple								=				True
					return sample





	def 	__snake_case					(      self					,							UpperCamelCase__					,							UpperCamelCase__					,							UpperCamelCase__		):

					def lms_derivative(UpperCamelCase__		):
									A__	:						Tuple								=				1.0
									for k in range(UpperCamelCase__		):
													if current_order == k:
																	continue
													prod *= (tau - self.sigmas[t - k]) / (self.sigmas[t - current_order] - self.sigmas[t - k])
									return prod

					A__	:						str								=				integrate.quad(UpperCamelCase__					,							self.sigmas[t]					,							self.sigmas[t + 1]					,							epsrel=1e-4		)[0]

					return integrated_coeff





	def 	__snake_case					(      self					,							UpperCamelCase__					,							UpperCamelCase__ = None		):
					A__	:						List[Any]								=				num_inference_steps

					# "linspace", "leading", "trailing" corresponds to annotation of Table 2. of https://arxiv.org/abs/2305.08891
					if self.config.timestep_spacing == "linspace":
									A__	:						Dict								=				np.linspace(0					,							self.config.num_train_timesteps - 1					,							UpperCamelCase__					,							dtype=UpperCamelCase__		)[
									    ::-1
									].copy()
					elif self.config.timestep_spacing == "leading":
									A__	:						str								=				self.config.num_train_timesteps // self.num_inference_steps
									# creates integer timesteps by multiplying by ratio
									# casting to int to avoid issues when num_inference_step is power of 3
									A__	:						str								=				(np.arange(0					,							UpperCamelCase__		) * step_ratio).round()[::-1].copy().astype(UpperCamelCase__		)
									timesteps += self.config.steps_offset
					elif self.config.timestep_spacing == "trailing":
									A__	:						Any								=				self.config.num_train_timesteps / self.num_inference_steps
									# creates integer timesteps by multiplying by ratio
									# casting to int to avoid issues when num_inference_step is power of 3
									A__	:						Optional[int]								=				(np.arange(self.config.num_train_timesteps					,							0					,							-step_ratio		)).round().copy().astype(UpperCamelCase__		)
									timesteps -= 1
					else:
									raise ValueError(
									    F"{self.config.timestep_spacing} is not supported. Please make sure to choose one of 'linspace', 'leading' or 'trailing'."		)

					A__	:						str								=				np.array(((1 - self.alphas_cumprod) / self.alphas_cumprod) ** 0.5		)
					A__	:						Union[str, Any]								=				np.log(UpperCamelCase__		)
					A__	:						Optional[Any]								=				np.interp(UpperCamelCase__					,							np.arange(0					,							len(UpperCamelCase__		)		)					,							UpperCamelCase__		)

					if self.use_karras_sigmas:
									A__	:						Dict								=				self._convert_to_karras(in_sigmas=UpperCamelCase__		)
									A__	:						List[Any]								=				np.array([self._sigma_to_t(UpperCamelCase__					,							UpperCamelCase__		) for sigma in sigmas]		)

					A__	:						int								=				np.concatenate([sigmas, [0.0]]		).astype(np.floataa		)

					A__	:						Dict								=				torch.from_numpy(UpperCamelCase__		).to(device=UpperCamelCase__		)
					if str(UpperCamelCase__		).startswith('''mps'''		):
									# mps does not support float64
									A__	:						Union[str, Any]								=				torch.from_numpy(UpperCamelCase__		).to(UpperCamelCase__					,							dtype=torch.floataa		)
					else:
									A__	:						str								=				torch.from_numpy(UpperCamelCase__		).to(device=UpperCamelCase__		)

					A__	:						List[Any]								=				[]





	def 	__snake_case					(      self					,							UpperCamelCase__					,							UpperCamelCase__		):
					# get log sigma
					A__	:						Any								=				np.log(UpperCamelCase__		)

					# get distribution
					A__	:						Optional[Any]								=				log_sigma - log_sigmas[:, np.newaxis]

					# get sigmas range
					A__	:						List[str]								=				np.cumsum((dists >= 0)					,							axis=0		).argmax(axis=0		).clip(max=log_sigmas.shape[0] - 2		)
					A__	:						Optional[Any]								=				low_idx + 1

					A__	:						Any								=				log_sigmas[low_idx]
					A__	:						int								=				log_sigmas[high_idx]

					# interpolate sigmas
					A__	:						Dict								=				(low - log_sigma) / (low - high)
					A__	:						List[Any]								=				np.clip(UpperCamelCase__					,							0					,							1		)

					# transform interpolation to time range
					A__	:						List[Any]								=				(1 - w) * low_idx + w * high_idx
					A__	:						List[Any]								=				t.reshape(sigma.shape		)
					return t





	def 	__snake_case					(      self					,							UpperCamelCase__		):
					A__	:						float								=				in_sigmas[-1].item()
					A__	:						float								=				in_sigmas[0].item()

					A__	:						Dict								=				7.0  # 7.0 is the value used in the paper
					A__	:						List[str]								=				np.linspace(0					,							1					,							self.num_inference_steps		)
					A__	:						Tuple								=				sigma_min ** (1 / rho)
					A__	:						Optional[Any]								=				sigma_max ** (1 / rho)
					A__	:						int								=				(max_inv_rho + ramp * (min_inv_rho - max_inv_rho)) ** rho
					return sigmas





	def 	__snake_case					(      self					,							UpperCamelCase__					,							UpperCamelCase__					,							UpperCamelCase__					,							UpperCamelCase__ = 4					,							UpperCamelCase__ = True					,							):
					if not self.is_scale_input_called:
									warnings.warn(
									    '''The `scale_model_input` function should be called before `step` to ensure correct denoising. '''
									    '''See `StableDiffusionPipeline` for a usage example.'''		)

					if isinstance(UpperCamelCase__					,							torch.Tensor		):
									A__	:						Any								=				timestep.to(self.timesteps.device		)
					A__	:						Optional[Any]								=				(self.timesteps == timestep).nonzero().item()
					A__	:						str								=				self.sigmas[step_index]

					# 1. compute predicted original sample (x_0) from sigma-scaled predicted noise
					if self.config.prediction_type == "epsilon":
									A__	:						Optional[Any]								=				sample - sigma * model_output
					elif self.config.prediction_type == "v_prediction":
									# * c_out + input * c_skip
									A__	:						Any								=				model_output * (-sigma / (sigma**2 + 1) ** 0.5) + (sample / (sigma**2 + 1))
					elif self.config.prediction_type == "sample":
									A__	:						Optional[int]								=				model_output
					else:
									raise ValueError(
									    F"prediction_type given as {self.config.prediction_type} must be one of `epsilon`, or `v_prediction`"		)

					# 2. Convert to an ODE derivative
					A__	:						Dict								=				(sample - pred_original_sample) / sigma
					self.derivatives.append(UpperCamelCase__		)
					if len(self.derivatives		) > order:
									self.derivatives.pop(0		)

					# 3. Compute linear multistep coefficients
					A__	:						Any								=				min(step_index + 1					,							UpperCamelCase__		)
					A__	:						str								=				[self.get_lms_coefficient(UpperCamelCase__					,							UpperCamelCase__					,							UpperCamelCase__		) for curr_order in range(UpperCamelCase__		)]

					# 4. Compute previous sample based on the derivatives path
					A__	:						Tuple								=				sample + sum(
					    coeff * derivative for coeff, derivative in zip(UpperCamelCase__					,							reversed(self.derivatives		)		)		)

					if not return_dict:
									return (prev_sample,)

					return LMSDiscreteSchedulerOutput(prev_sample=UpperCamelCase__					,							pred_original_sample=UpperCamelCase__		)





	def 	__snake_case					(      self					,							UpperCamelCase__					,							UpperCamelCase__					,							UpperCamelCase__					,							):
					# Make sure sigmas and timesteps have the same device and dtype as original_samples
					A__	:						List[Any]								=				self.sigmas.to(device=original_samples.device					,							dtype=original_samples.dtype		)
					if original_samples.device.type == "mps" and torch.is_floating_point(UpperCamelCase__		):
									# mps does not support float64
									A__	:						Union[str, Any]								=				self.timesteps.to(original_samples.device					,							dtype=torch.floataa		)
									A__	:						int								=				timesteps.to(original_samples.device					,							dtype=torch.floataa		)
					else:
									A__	:						Dict								=				self.timesteps.to(original_samples.device		)
									A__	:						Dict								=				timesteps.to(original_samples.device		)

					A__	:						List[Any]								=				[(schedule_timesteps == t).nonzero().item() for t in timesteps]

					A__	:						Dict								=				sigmas[step_indices].flatten()
					while len(sigma.shape		) < len(original_samples.shape		):
									A__	:						Optional[Any]								=				sigma.unsqueeze(-1		)

					A__	:						Optional[Any]								=				original_samples + noise * sigma
					return noisy_samples





	def __len__(      self		):
					return self.config.num_train_timesteps

import unittest

from transformers.testing_utils import is_torch_available, require_torch, tooslow

from ...generation.test_utils import torch_device
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
					import torch

					from transformers import (
					    CpmAntConfig,
					    CpmAntForCausalLM,
					    CpmAntModel,
					    CpmAntTokenizer,
					)







@require_torch
class 			UpperCamelCase__		:







	'''simple docstring'''





	def __init__(      self					,							UpperCamelCase__					,							UpperCamelCase__=2					,							UpperCamelCase__=8					,							UpperCamelCase__=True					,							UpperCamelCase__=False					,							UpperCamelCase__=False					,							UpperCamelCase__=False					,							UpperCamelCase__=False					,							UpperCamelCase__=99					,							UpperCamelCase__=32					,							UpperCamelCase__=3					,							UpperCamelCase__=4					,							UpperCamelCase__=37					,							UpperCamelCase__=32					,							UpperCamelCase__=128					,							UpperCamelCase__=8					,							UpperCamelCase__=8					,							UpperCamelCase__=8					,							UpperCamelCase__=1.0					,							UpperCamelCase__=True					,							):
					A__	:						Dict								=				parent
					A__	:						Optional[int]								=				batch_size
					A__	:						Any								=				seq_length
					A__	:						Tuple								=				is_training
					A__	:						List[str]								=				use_token_type_ids
					A__	:						List[Any]								=				use_input_mask
					A__	:						Any								=				use_labels
					A__	:						Dict								=				use_mc_token_ids
					A__	:						Tuple								=				vocab_size
					A__	:						Any								=				hidden_size
					A__	:						List[Any]								=				num_hidden_layers
					A__	:						Union[str, Any]								=				num_attention_heads
					A__	:						Tuple								=				intermediate_size
					A__	:						Union[str, Any]								=				num_buckets
					A__	:						Dict								=				max_distance
					A__	:						str								=				prompt_length
					A__	:						int								=				prompt_types
					A__	:						int								=				segment_types
					A__	:						Union[str, Any]								=				init_std
					A__	:						Dict								=				return_dict





	def 	__snake_case					(      self		):
					A__	:						Optional[int]								=				{}
					A__	:						List[Any]								=				ids_tensor([self.batch_size, self.seq_length]					,							self.vocab_size		).type(torch.intaa		)
					A__	:						Dict								=				False

					A__	:						Union[str, Any]								=				self.get_config()

					return (config, input_ids)





	def 	__snake_case					(      self		):
					return CpmAntConfig(
					    vocab_size=self.vocab_size					,							hidden_size=self.hidden_size					,							num_hidden_layers=self.num_hidden_layers					,							num_attention_heads=self.num_attention_heads					,							dim_ff=self.intermediate_size					,							position_bias_num_buckets=self.num_buckets					,							position_bias_max_distance=self.max_distance					,							prompt_types=self.prompt_types					,							prompt_length=self.prompt_length					,							segment_types=self.segment_types					,							use_cache=UpperCamelCase__					,							init_std=self.init_std					,							return_dict=self.return_dict					,							)





	def 	__snake_case					(      self					,							UpperCamelCase__					,							UpperCamelCase__					,							*UpperCamelCase__		):
					A__	:						Tuple								=				CpmAntModel(config=UpperCamelCase__		)
					model.to(UpperCamelCase__		)
					model.eval()

					A__	:						Union[str, Any]								=				model(**UpperCamelCase__		).last_hidden_state

					self.parent.assertEqual(hidden_states.shape					,							(self.batch_size, self.seq_length, config.hidden_size)		)





	def 	__snake_case					(      self					,							UpperCamelCase__					,							UpperCamelCase__					,							*UpperCamelCase__		):
					A__	:						int								=				CpmAntForCausalLM(UpperCamelCase__		)
					model.to(UpperCamelCase__		)
					A__	:						Any								=				input_ids['''input_ids'''].to(UpperCamelCase__		)
					model.eval()

					A__	:						Dict								=				model(**UpperCamelCase__		)
					self.parent.assertEqual(
					    model_output.logits.shape					,							(self.batch_size, self.seq_length, config.vocab_size + config.prompt_types * config.prompt_length)					,							)





	def 	__snake_case					(      self		):
					A__							,				A__	:						List[str]								=				self.prepare_config_and_inputs()
					return config, inputs_dict







@require_torch
class 			UpperCamelCase__		(     SCREAMING_SNAKE_CASE_,      SCREAMING_SNAKE_CASE_,      unittest.TestCase ):







	'''simple docstring'''
	_lowerCAmelCase											=					(CpmAntModel, CpmAntForCausalLM) if is_torch_available() else ()
	_lowerCAmelCase											=					(
	    {"feature-extraction": CpmAntModel, "text-generation": CpmAntForCausalLM} if is_torch_available() else {}
	)

	_lowerCAmelCase											=					False
	_lowerCAmelCase											=					False
	_lowerCAmelCase											=					False
	_lowerCAmelCase											=					False
	_lowerCAmelCase											=					False





	def 	__snake_case					(      self		):
					A__	:						Optional[int]								=				CpmAntModelTester(self		)
					A__	:						List[str]								=				ConfigTester(self					,							config_class=UpperCamelCase__		)





	def 	__snake_case					(      self		):
					self.config_tester.create_and_test_config_common_properties()
					self.config_tester.create_and_test_config_to_json_string()
					self.config_tester.create_and_test_config_to_json_file()
					self.config_tester.create_and_test_config_from_and_save_pretrained()
					self.config_tester.check_config_can_be_init_without_params()
					self.config_tester.check_config_arguments_init()





	def 	__snake_case					(      self		):
					unittest.skip('''CPMAnt doesn\'t support input_embeds.'''		)(self.test_inputs_embeds		)





	def 	__snake_case					(      self		):
					unittest.skip(
					    '''CPMAnt doesn\'t support retain grad in hidden_states or attentions, because prompt management will peel off the output.hidden_states from graph.\
                 So is attentions. We strongly recommand you use loss to tune model.'''		)(self.test_retain_grad_hidden_states_attentions		)





	def 	__snake_case					(      self		):
					A__							,				A__	:						Tuple								=				self.model_tester.prepare_config_and_inputs()
					self.model_tester.create_and_check_cpmant_model(UpperCamelCase__					,							UpperCamelCase__		)





	def 	__snake_case					(      self		):
					A__							,				A__	:						List[str]								=				self.model_tester.prepare_config_and_inputs()
					self.model_tester.create_and_check_lm_head_model(UpperCamelCase__					,							UpperCamelCase__		)







@require_torch
class 			UpperCamelCase__		(     unittest.TestCase ):







	'''simple docstring'''





	@tooslow
	def 	__snake_case					(      self		):
					A__	:						Optional[int]								=				'''今天天气真好！'''
					A__	:						Any								=				'''openbmb/cpm-ant-10b'''
					A__	:						Tuple								=				CpmAntModel.from_pretrained(UpperCamelCase__		)
					A__	:						str								=				CpmAntTokenizer.from_pretrained(UpperCamelCase__		)
					A__	:						Union[str, Any]								=				tokenizer(UpperCamelCase__					,							return_tensors='''pt'''		)
					A__	:						Tuple								=				model(**UpperCamelCase__		).last_hidden_state

					A__	:						str								=				torch.tensor(
					    [[[6.1_7_0_8, 5.9_2_4_4, 1.0_8_3_5], [6.5_2_0_7, 6.2_8_9_3, -1_1.3_3_2_4], [-1.0_1_0_7, -0.0_5_7_6, -5.9_5_7_7]]]					,							)
					self.assertTrue(torch.allclose(hidden_states[:, :3, :3]					,							UpperCamelCase__					,							atol=1e-2		)		)







@require_torch
class 			UpperCamelCase__		(     unittest.TestCase ):







	'''simple docstring'''





	@tooslow
	def 	__snake_case					(      self		):
					A__	:						Union[str, Any]								=				'''今天天气真好！'''
					A__	:						List[str]								=				'''openbmb/cpm-ant-10b'''
					A__	:						Tuple								=				CpmAntForCausalLM.from_pretrained(UpperCamelCase__		)
					A__	:						Tuple								=				CpmAntTokenizer.from_pretrained(UpperCamelCase__		)
					A__	:						Union[str, Any]								=				tokenizer(UpperCamelCase__					,							return_tensors='''pt'''		)
					A__	:						Optional[Any]								=				model(**UpperCamelCase__		).logits

					A__	:						List[str]								=				torch.tensor(
					    [[[-6.4_2_6_7, -6.4_0_8_3, -6.3_9_5_8], [-5.8_8_0_2, -5.9_4_4_7, -5.7_8_1_1], [-5.3_8_9_6, -5.4_8_2_0, -5.4_2_9_5]]]					,							)
					self.assertTrue(torch.allclose(hidden_states[:, :3, :3]					,							UpperCamelCase__					,							atol=1e-2		)		)





	@tooslow
	def 	__snake_case					(      self		):
					A__	:						Tuple								=				'''openbmb/cpm-ant-10b'''
					A__	:						Tuple								=				CpmAntForCausalLM.from_pretrained(UpperCamelCase__		)
					A__	:						Optional[Any]								=				CpmAntTokenizer.from_pretrained(UpperCamelCase__		)
					A__	:						int								=				'''今天天气不错，'''
					A__	:						Dict								=				'''今天天气不错，阳光明媚，我和妈妈一起去超市买东西。\n在超市里，我看到了一个很好玩的玩具，它的名字叫“机器人”。它有一个圆圆的脑袋，两只圆圆的眼睛，还有一个圆圆的'''
					A__	:						Dict								=				tokenizer(UpperCamelCase__					,							return_tensors='''pt'''		)
					A__	:						Any								=				model.generate(**UpperCamelCase__		)
					A__	:						List[str]								=				tokenizer.batch_decode(UpperCamelCase__		)
					self.assertEqual(UpperCamelCase__					,							UpperCamelCase__		)





	@tooslow
	def 	__snake_case					(      self		):
					A__	:						Optional[int]								=				'''openbmb/cpm-ant-10b'''
					A__	:						Tuple								=				CpmAntForCausalLM.from_pretrained(UpperCamelCase__		)
					A__	:						List[Any]								=				CpmAntTokenizer.from_pretrained(UpperCamelCase__		)
					A__	:						Optional[Any]								=				['''今天天气不错，''', '''新年快乐，万事如意！''']
					A__	:						Any								=				[
					    '''今天天气不错，阳光明媚，我和妈妈一起去超市买东西。\n在超市里，我看到了一个很好玩的玩具，它的名字叫“机器人”。它有一个圆圆的脑袋，两只圆圆的眼睛，还有一个圆圆的''',
					    '''新年快乐，万事如意！在这辞旧迎新的美好时刻，我谨代表《农村新技术》杂志社全体同仁，向一直以来关心、支持《农村新技术》杂志发展的各级领导、各界朋友和广大读者致以最诚挚的''',
					]
					A__	:						Optional[int]								=				tokenizer(UpperCamelCase__					,							return_tensors='''pt'''					,							padding=UpperCamelCase__		)
					A__	:						Any								=				model.generate(**UpperCamelCase__		)
					A__	:						Optional[Any]								=				tokenizer.batch_decode(UpperCamelCase__		)
					self.assertEqual(UpperCamelCase__					,							UpperCamelCase__		)