





"""simple docstring"""
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  _SCREAMING_SNAKE_CASE(       unittest.TestCase   ,     A  ):




       def    _UpperCamelCase					(						self							)      ->				Any:





             """simple docstring"""






             __SCREAMING_SNAKE_CASE       :Tuple		    =  load_tool('''text-to-speech'''							)
             self.tool.setup()




       def    _UpperCamelCase					(						self							)      ->				Dict:





             """simple docstring"""






             torch.manual_seed(0							)
             __SCREAMING_SNAKE_CASE       :Dict		    =  self.tool('''hey'''							)
             __SCREAMING_SNAKE_CASE       :Union[str, Any]		    =  result.to_raw()
             self.assertTrue(
                 torch.allclose(
                     resulting_tensor[:3]		,torch.tensor([-0.0_0_0_5_9_6_6_6_6_8_8_3_2_1_1_5_8_2_9, -0.0_0_0_3_6_5_7_6_4_0_1_9_0_7_9_5_0_6_4, -0.0_0_0_1_3_4_3_9_5_0_2_7_9_9_8_8_3_4_8_5]							)		,)							)




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





             """simple docstring"""






             torch.manual_seed(0							)
             __SCREAMING_SNAKE_CASE       :Dict		    =  self.tool('''hey'''							)
             __SCREAMING_SNAKE_CASE       :Any		    =  result.to_raw()
             self.assertTrue(
                 torch.allclose(
                     resulting_tensor[:3]		,torch.tensor([-0.0_0_0_5_9_6_6_6_6_8_8_3_2_1_1_5_8_2_9, -0.0_0_0_3_6_5_7_6_4_0_1_9_0_7_9_5_0_6_4, -0.0_0_0_1_3_4_3_9_5_0_2_7_9_9_8_8_3_4_8_5]							)		,)							)






"""simple docstring"""
from torch import nn






class  _SCREAMING_SNAKE_CASE(       nn.Module  ):




       def __init__(						self		,SCREAMING_SNAKE_CASE__		,SCREAMING_SNAKE_CASE__							)      ->				List[str]:





             """simple docstring"""






             super().__init__()
             __SCREAMING_SNAKE_CASE       :Tuple		    =  class_size
             __SCREAMING_SNAKE_CASE       :str		    =  embed_size
             # self.mlp1 = nn.Linear(embed_size, embed_size)
             # self.mlp2 = (nn.Linear(embed_size, class_size))
             __SCREAMING_SNAKE_CASE       :Optional[Any]		    =  nn.Linear(SCREAMING_SNAKE_CASE__		,SCREAMING_SNAKE_CASE__							)




       def    _UpperCamelCase					(						self		,SCREAMING_SNAKE_CASE__							)      ->				Optional[int]:





             """simple docstring"""






             __SCREAMING_SNAKE_CASE       :Optional[Any]		    =  self.mlp(SCREAMING_SNAKE_CASE__							)
             return logits