





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        _a(    __A	,   __A    ):







		@register_to_config
		def __init__(    self ,						__snake_case = 7_6_8 ,						)      ->      Optional[int]:


							'''simple docstring'''

							super().__init__()

							_snake_case       :					str				       =   nn.Parameter(torch.zeros(1 ,						__snake_case				)				)
							_snake_case       :					Any				       =   nn.Parameter(torch.ones(1 ,						__snake_case				)				)







		def        lowercase       (    self ,						__snake_case = None ,						__snake_case = None ,						)      ->      List[Any]:


							'''simple docstring'''

							_snake_case       :					Dict				       =   nn.Parameter(self.mean.to(__snake_case				).to(__snake_case				)				)
							_snake_case       :					Tuple				       =   nn.Parameter(self.std.to(__snake_case				).to(__snake_case				)				)
							return self







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


							'''simple docstring'''

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







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


							'''simple docstring'''

							_snake_case       :					Optional[int]				       =   (embeds * self.std) + self.mean
							return embeds






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__lowerCAmelCase :str     =    {
    'configuration_nllb_moe': [
        'NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'NllbMoeConfig',
    ]
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__lowerCAmelCase :Optional[int]     =    [
							    'NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'NllbMoeForConditionalGeneration',
							    'NllbMoeModel',
							    'NllbMoePreTrainedModel',
							    'NllbMoeTop2Router',
							    'NllbMoeSparseMLP',
							]


if TYPE_CHECKING:
							from .configuration_nllb_moe import (
							    NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP,
							    NllbMoeConfig,
							)

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_nllb_moe import (
														    NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST,
														    NllbMoeForConditionalGeneration,
														    NllbMoeModel,
														    NllbMoePreTrainedModel,
														    NllbMoeSparseMLP,
														    NllbMoeTopaRouter,
														)


else:
							import sys

							__lowerCAmelCase :int     =    _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)