


'''simple docstring'''
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


UpperCAmelCase_			:  Optional[Any]										=   {
    'configuration_transfo_xl': ['TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP', 'TransfoXLConfig'],
    'tokenization_transfo_xl': ['TransfoXLCorpus', 'TransfoXLTokenizer'],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 UpperCAmelCase_			:  Any										=   [
     'TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST',
     'AdaptiveEmbedding',
     'TransfoXLForSequenceClassification',
     'TransfoXLLMHeadModel',
     'TransfoXLModel',
     'TransfoXLPreTrainedModel',
     'load_tf_weights_in_transfo_xl',
 ]

try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 UpperCAmelCase_			:  Optional[Any]										=   [
     'TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST',
     'TFAdaptiveEmbedding',
     'TFTransfoXLForSequenceClassification',
     'TFTransfoXLLMHeadModel',
     'TFTransfoXLMainLayer',
     'TFTransfoXLModel',
     'TFTransfoXLPreTrainedModel',
 ]


if TYPE_CHECKING:
 from .configuration_transfo_xl import TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP, TransfoXLConfig
 from .tokenization_transfo_xl import TransfoXLCorpus, TransfoXLTokenizer

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_transfo_xl import (
      TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST,
      AdaptiveEmbedding,
      TransfoXLForSequenceClassification,
      TransfoXLLMHeadModel,
      TransfoXLModel,
      TransfoXLPreTrainedModel,
      load_tf_weights_in_transfo_xl,
  )

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_transfo_xl import (
      TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST,
      TFAdaptiveEmbedding,
      TFTransfoXLForSequenceClassification,
      TFTransfoXLLMHeadModel,
      TFTransfoXLMainLayer,
      TFTransfoXLModel,
      TFTransfoXLPreTrainedModel,
  )

else:
 import sys

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










'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCAmelCase_			:  Optional[int]										=   logging.get_logger(__name__)

UpperCAmelCase_			:  List[str]										=   {
    'google/fnet-base': 'https://huggingface.co/google/fnet-base/resolve/main/config.json',
    'google/fnet-large': 'https://huggingface.co/google/fnet-large/resolve/main/config.json'
    # See all FNet models at https://huggingface.co/models?filter=fnet
}

class     _lowerCamelCase       (     snake_case_					):




 '''simple docstring'''
 __lowercase					:		List[Any]     				=    '''fnet'''


 def __init__(   self   ,   __lowercase=32_000   ,   __lowercase=768   ,   __lowercase=12   ,   __lowercase=3_072   ,   __lowercase="gelu_new"   ,   __lowercase=0.1   ,   __lowercase=512   ,   __lowercase=4   ,   __lowercase=0.0_2   ,   __lowercase=1E-12   ,   __lowercase=False   ,   __lowercase=512   ,   __lowercase=3   ,   __lowercase=1   ,   __lowercase=2   ,   **__lowercase   ,   ):

  """simple docstring"""







  super().__init__(pad_token_id=__lowercase   ,   bos_token_id=__lowercase   ,   eos_token_id=__lowercase   ,   **__lowercase    )

  __A	:		Union[str, Any]	  =      vocab_size
  __A	:		Dict	  =      max_position_embeddings
  __A	:		List[str]	  =      hidden_size
  __A	:		Tuple	  =      num_hidden_layers
  __A	:		Optional[int]	  =      intermediate_size
  __A	:		Dict	  =      hidden_act
  __A	:		List[str]	  =      hidden_dropout_prob
  __A	:		str	  =      initializer_range
  __A	:		Dict	  =      type_vocab_size
  __A	:		int	  =      layer_norm_eps
  __A	:		Tuple	  =      use_tpu_fourier_optimizations
  __A	:		Optional[Any]	  =      tpu_short_seq_length






