from ...configuration_utils import PretrainedConfig
from ...utils import logging


SCREAMING_SNAKE_CASE		:     int         =	logging.get_logger(__name__)

SCREAMING_SNAKE_CASE		:     Optional[Any]         =	{
    "microsoft/cvt-13": "https://huggingface.co/microsoft/cvt-13/resolve/main/config.json",
    # See all Cvt models at https://huggingface.co/models?filter=cvt
}

class        UpperCamelCase						(				__a				):
						a__		:str      =			'''cvt'''





						def __init__(self			,     __UpperCamelCase=3			,     __UpperCamelCase=[7, 3, 3]			,     __UpperCamelCase=[4, 2, 2]			,     __UpperCamelCase=[2, 1, 1]			,     __UpperCamelCase=[64, 192, 384]			,     __UpperCamelCase=[1, 3, 6]			,     __UpperCamelCase=[1, 2, 10]			,     __UpperCamelCase=[4.0, 4.0, 4.0]			,     __UpperCamelCase=[0.0, 0.0, 0.0]			,     __UpperCamelCase=[0.0, 0.0, 0.0]			,     __UpperCamelCase=[0.0, 0.0, 0.1]			,     __UpperCamelCase=[True, True, True]			,     __UpperCamelCase=[False, False, True]			,     __UpperCamelCase=["dw_bn", "dw_bn", "dw_bn"]			,     __UpperCamelCase=[3, 3, 3]			,     __UpperCamelCase=[1, 1, 1]			,     __UpperCamelCase=[2, 2, 2]			,     __UpperCamelCase=[1, 1, 1]			,     __UpperCamelCase=[1, 1, 1]			,     __UpperCamelCase=0.02			,     __UpperCamelCase=1E-1_2			,     **__UpperCamelCase			,     )				->				List[Any]:
												super().__init__(**__UpperCamelCase						)
												UpperCamelCase_		:							Optional[Any]  =		num_channels
												UpperCamelCase_		:							Optional[int]  =		patch_sizes
												UpperCamelCase_		:							Optional[int]  =		patch_stride
												UpperCamelCase_		:							str  =		patch_padding
												UpperCamelCase_		:							List[Any]  =		embed_dim
												UpperCamelCase_		:							str  =		num_heads
												UpperCamelCase_		:							Any  =		depth
												UpperCamelCase_		:							List[Any]  =		mlp_ratio
												UpperCamelCase_		:							int  =		attention_drop_rate
												UpperCamelCase_		:							List[Any]  =		drop_rate
												UpperCamelCase_		:							Optional[int]  =		drop_path_rate
												UpperCamelCase_		:							int  =		qkv_bias
												UpperCamelCase_		:							Optional[int]  =		cls_token
												UpperCamelCase_		:							Optional[Any]  =		qkv_projection_method
												UpperCamelCase_		:							int  =		kernel_qkv
												UpperCamelCase_		:							Any  =		padding_kv
												UpperCamelCase_		:							Union[str, Any]  =		stride_kv
												UpperCamelCase_		:							List[str]  =		padding_q
												UpperCamelCase_		:							Any  =		stride_q
												UpperCamelCase_		:							Optional[int]  =		initializer_range
												UpperCamelCase_		:							int  =		layer_norm_eps







import unittest

from transformers import load_tool
from transformers.utils import is_torch_available


if is_torch_available():
	import torch

from transformers.testing_utils import require_torch

from .test_tools_common import ToolTesterMixin

@require_torch
class        UpperCamelCase						(				unittest.TestCase	,	__a				):





						def        A_							(self						)				->				Tuple:
												UpperCamelCase_		:							Any  =		load_tool("""text-to-speech"""						)
												self.tool.setup()





						def        A_							(self						)				->				Dict:
												# SpeechT5 isn't deterministic
												torch.manual_seed(0						)
												UpperCamelCase_		:							Optional[Any]  =		self.tool("""hey"""						)
												UpperCamelCase_		:							Optional[Any]  =		result.to_raw()
												self.assertTrue(
												    torch.allclose(
												        resulting_tensor[:3]			,     torch.tensor([-0.0_005_966_668_832_115_829, -0.0_003_657_640_190_795_064, -0.00_013_439_502_799_883_485]						)			,     )						)





						def        A_							(self						)				->				Dict:
												# SpeechT5 isn't deterministic
												torch.manual_seed(0						)
												UpperCamelCase_		:							Any  =		self.tool("""hey"""						)
												UpperCamelCase_		:							Tuple  =		result.to_raw()
												self.assertTrue(
												    torch.allclose(
												        resulting_tensor[:3]			,     torch.tensor([-0.0_005_966_668_832_115_829, -0.0_003_657_640_190_795_064, -0.00_013_439_502_799_883_485]						)			,     )						)






