
'''simple docstring'''




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





     @register_to_config
     def __init__(							self						,			SCREAMING_SNAKE_CASE = 768						,			) ->				Dict:






         """simple docstring"""






         super().__init__()

         A       :   List[Any]					=						nn.Parameter(torch.zeros(1						,			SCREAMING_SNAKE_CASE	)	)
         A       :   List[str]					=						nn.Parameter(torch.ones(1						,			SCREAMING_SNAKE_CASE	)	)





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE = None						,			SCREAMING_SNAKE_CASE = None						,			) ->				List[Any]:






         """simple docstring"""






         A       :   str					=						nn.Parameter(self.mean.to(SCREAMING_SNAKE_CASE	).to(SCREAMING_SNAKE_CASE	)	)
         A       :   Any					=						nn.Parameter(self.std.to(SCREAMING_SNAKE_CASE	).to(SCREAMING_SNAKE_CASE	)	)
         return self





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE	) ->				List[str]:






         """simple docstring"""






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





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE	) ->				List[str]:






         """simple docstring"""






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








'''simple docstring'''

a_  :				Any						= """0.21.0"""

from .accelerator import Accelerator
from .big_modeling import (
    cpu_offload,
    cpu_offload_with_hook,
    disk_offload,
    dispatch_model,
    init_empty_weights,
    init_on_device,
    load_checkpoint_and_dispatch,
)
from .data_loader import skip_first_batches
from .launchers import debug_launcher, notebook_launcher
from .state import PartialState
from .utils import (
    DeepSpeedPlugin,
    DistributedDataParallelKwargs,
    DistributedType,
    FullyShardedDataParallelPlugin,
    GradScalerKwargs,
    InitProcessGroupKwargs,
    find_executable_batch_size,
    infer_auto_device_map,
    is_rich_available,
    load_checkpoint_in_model,
    synchronize_rng_states,
)


if is_rich_available():
     from .utils import rich



