





from typing import Optional, Union

import torch
from torch import nn

from ...configuration_utils import ConfigMixin, register_to_config
from ...models.modeling_utils import ModelMixin


class 			lowercase				(							lowercase__		,			lowercase__     ):



						"""simple docstring"""

						@register_to_config
						def __init__(    self			:		List[Any] ,				lowerCamelCase_			:		int = 7_68 ,				):





										'''simple docstring'''







										super().__init__()

										_snake_case :			List[Any]  						=   nn.Parameter(torch.zeros(1 ,				__lowerCamelCase					)					)
										_snake_case :			int  						=   nn.Parameter(torch.ones(1 ,				__lowerCamelCase					)					)







						def 		__UpperCAmelCase       (    self			:		Union[str, Any] ,				lowerCamelCase_			:		Optional[Union[str, torch.device]] = None ,				lowerCamelCase_			:		Optional[torch.dtype] = None ,				):





										'''simple docstring'''







										_snake_case :			Dict  						=   nn.Parameter(self.mean.to(__lowerCamelCase					).to(__lowerCamelCase					)					)
										_snake_case :			Union[str, Any]  						=   nn.Parameter(self.std.to(__lowerCamelCase					).to(__lowerCamelCase					)					)
										return self







						def 		__UpperCAmelCase       (    self			:		List[str] ,				lowerCamelCase_			:		Union[str, Any]					):





										'''simple docstring'''







										_snake_case :			str  						=   (embeds - self.mean) * 1.0 / self.std
										return embeds







						def 		__UpperCAmelCase       (    self			:		Optional[Any] ,				lowerCamelCase_			:		Optional[Any]					):





										'''simple docstring'''







										_snake_case :			Union[str, Any]  						=   (embeds * self.std) + self.mean
										return embeds













lowercase_		:				Tuple				=						'''
# Installazione di Transformers
! pip install transformers datasets
# Per installare dalla fonte invece dell\'ultima versione rilasciata, commenta il comando sopra e
# rimuovi la modalità commento al comando seguente.
# ! pip install git+https://github.com/huggingface/transformers.git
'''

lowercase_		:				Optional[int]				=						[{'''type''': '''code''', '''content''': INSTALL_CONTENT}]
lowercase_		:				str				=						{
    '''{processor_class}''': '''FakeProcessorClass''',
    '''{model_class}''': '''FakeModelClass''',
    '''{object_class}''': '''FakeObjectClass''',
}






