



"""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  _lowerCAmelCase     (					SCREAMING_SNAKE_CASE__	,					SCREAMING_SNAKE_CASE__		):





		"""simple docstring"""






		@register_to_config
		def __init__(       self				,     _lowercase = 7_6_8				,     )			->    Tuple:







								'''simple docstring'''

								super().__init__()

								snake_case_ :			Optional[Any]            =      nn.Parameter(torch.zeros(1				,     _lowercase ) )
								snake_case_ :			List[str]            =      nn.Parameter(torch.ones(1				,     _lowercase ) )





		def  UpperCAmelCase__				(       self				,     _lowercase = None				,     _lowercase = None				,     )			->    str:







								'''simple docstring'''

								snake_case_ :			Any            =      nn.Parameter(self.mean.to(_lowercase ).to(_lowercase ) )
								snake_case_ :			List[Any]            =      nn.Parameter(self.std.to(_lowercase ).to(_lowercase ) )
								return self





		def  UpperCAmelCase__				(       self				,     _lowercase )			->    str:







								'''simple docstring'''

								snake_case_ :			List[Any]            =      (embeds - self.mean) * 1.0 / self.std
								return embeds





		def  UpperCAmelCase__				(       self				,     _lowercase )			->    Tuple:







								'''simple docstring'''

								snake_case_ :			str            =      (embeds * self.std) + self.mean
								return embeds



'''simple docstring'''




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowercase     :							Tuple       						=     {
    'configuration_luke': ['LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP', 'LukeConfig'],
    'tokenization_luke': ['LukeTokenizer'],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase     :							int       						=     [
          'LUKE_PRETRAINED_MODEL_ARCHIVE_LIST',
          'LukeForEntityClassification',
          'LukeForEntityPairClassification',
          'LukeForEntitySpanClassification',
          'LukeForMultipleChoice',
          'LukeForQuestionAnswering',
          'LukeForSequenceClassification',
          'LukeForTokenClassification',
          'LukeForMaskedLM',
          'LukeModel',
          'LukePreTrainedModel',
      ]


if TYPE_CHECKING:
      from .configuration_luke import LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP, LukeConfig
      from .tokenization_luke import LukeTokenizer

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_luke import (
                LUKE_PRETRAINED_MODEL_ARCHIVE_LIST,
                LukeForEntityClassification,
                LukeForEntityPairClassification,
                LukeForEntitySpanClassification,
                LukeForMaskedLM,
                LukeForMultipleChoice,
                LukeForQuestionAnswering,
                LukeForSequenceClassification,
                LukeForTokenClassification,
                LukeModel,
                LukePreTrainedModel,
            )

else:
      import sys

      lowercase     :							Dict       						=     _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




