




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

    '''simple docstring'''






    @register_to_config
    def __init__(			self      :	Dict					, UpperCAmelCase__      :	int = 768					, )						->Tuple:





           '''simple docstring'''

           super().__init__()

           A__       =    nn.Parameter(torch.zeros(1					, UpperCAmelCase__))
           A__       =    nn.Parameter(torch.ones(1					, UpperCAmelCase__))


    def        SCREAMING_SNAKE_CASE							(			self      :	Union[str, Any]					, UpperCAmelCase__      :	Optional[Union[str, torch.device]] = None					, UpperCAmelCase__      :	Optional[torch.dtype] = None					, )						->List[str]:





           '''simple docstring'''

           A__       =    nn.Parameter(self.mean.to(UpperCAmelCase__).to(UpperCAmelCase__))
           A__       =    nn.Parameter(self.std.to(UpperCAmelCase__).to(UpperCAmelCase__))
           return self


    def        SCREAMING_SNAKE_CASE							(			self      :	Tuple					, UpperCAmelCase__      :	Tuple)						->Dict:





           '''simple docstring'''

           A__       =    (embeds - self.mean) * 1.0 / self.std
           return embeds





    def        SCREAMING_SNAKE_CASE							(			self      :	str					, UpperCAmelCase__      :	Union[str, Any])						->str:





           '''simple docstring'''

           A__       =    (embeds * self.std) + self.mean
           return embeds






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCAmelCase__   	=							{
    '''configuration_timesformer''': ['''TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''TimesformerConfig'''],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase__   	=							[
      '''TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
      '''TimesformerModel''',
      '''TimesformerForVideoClassification''',
      '''TimesformerPreTrainedModel''',
  ]

if TYPE_CHECKING:
  from .configuration_timesformer import TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimesformerConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_timesformer import (
        TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
        TimesformerForVideoClassification,
        TimesformerModel,
        TimesformerPreTrainedModel,
    )

else:
  import sys

  UpperCAmelCase__   	=							_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

