
import torch
import torch.nn as nn
from transformers.modeling_utils import ModuleUtilsMixin
from transformers.models.ta.modeling_ta import TaBlock, TaConfig, TaLayerNorm

from ...configuration_utils import ConfigMixin, register_to_config
from ...models import ModelMixin




class    SCREAMING_SNAKE_CASE__     (	UpperCAmelCase							,UpperCAmelCase							,UpperCAmelCase					):





	'''simple docstring'''



	@register_to_config
	def __init__(  self	:    Dict			,  lowercase	:    int			,  lowercase	:    int			,  lowercase	:    int			,  lowercase	:    float			,  lowercase	:    int			,  lowercase	:    int			,  lowercase	:    int			,  lowercase	:    int			,  lowercase	:    str			,  lowercase	:    bool = False			,  ):


				'''simple docstring'''


				super().__init__()

				_snake_case		=			nn.Embedding(lowercase			,  lowercase	)

				_snake_case		=			nn.Embedding(lowercase			,  lowercase	)
				_snake_case		=			False

				_snake_case		=			nn.Dropout(p=lowercase	)

				_snake_case		=			TaConfig(
				    vocab_size=lowercase			,  d_model=lowercase			,  num_heads=lowercase			,  d_kv=lowercase			,  d_ff=lowercase			,  dropout_rate=lowercase			,  feed_forward_proj=lowercase			,  is_decoder=lowercase			,  is_encoder_decoder=lowercase			,  )

				_snake_case		=			nn.ModuleList()
				for lyr_num in range(lowercase	):
							_snake_case		=			TaBlock(lowercase	)
							self.encoders.append(lowercase	)

				_snake_case		=			TaLayerNorm(lowercase	)
				_snake_case		=			nn.Dropout(p=lowercase	)





	def  A							(  self	:    Dict			,  lowercase	:    Any			,  lowercase	:    str	):


				'''simple docstring'''


				_snake_case		=			self.token_embedder(lowercase	)

				_snake_case		=			encoder_input_tokens.shape[1]
				_snake_case		=			torch.arange(lowercase			,  device=encoder_input_tokens.device	)
				x += self.position_encoding(lowercase	)

				_snake_case		=			self.dropout_pre(lowercase	)

				# inverted the attention mask
				_snake_case		=			encoder_input_tokens.size()
				_snake_case		=			self.get_extended_attention_mask(lowercase			,  lowercase	)

				for lyr in self.encoders:
							_snake_case		=			lyr(lowercase			,  lowercase	)[0]
				_snake_case		=			self.layer_norm(lowercase	)

				return self.dropout_post(lowercase	), encoder_inputs_mask

_lowerCamelCase       :				int       =			[4, 1, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
_lowerCamelCase       :				str       =			[3, 7, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
_lowerCamelCase       :				List[str]       =			{
    0: '''Sunday''',
    1: '''Monday''',
    2: '''Tuesday''',
    3: '''Wednesday''',
    4: '''Thursday''',
    5: '''Friday''',
    6: '''Saturday''',
}






def        a_		(       __lowercase   :	int       ,					__lowercase   :	int       ,					__lowercase   :	int ) ->  str:
			assert len(str(__lowercase ) ) > 2, "year should be in YYYY format"
			assert 1 <= month <= 12, "month should be between 1 to 12"
			assert 1 <= day <= 31, "day should be between 1 to 31"

			# Doomsday algorithm:
			_snake_case		=			year // 100
			_snake_case		=			(5 * (century % 4) + 2) % 7
			_snake_case		=			year % 100
			_snake_case		=			centurian % 12
			_snake_case		=			(
			    (centurian // 12) + centurian_m + (centurian_m // 4) + century_anchor
			) % 7
			_snake_case		=			(
			    DOOMSDAY_NOT_LEAP[month - 1]
			    if (year % 4 != 0) or (centurian == 0 and (year % 400) == 0)
			    else DOOMSDAY_LEAP[month - 1]
			)
			_snake_case		=			(dooms_day + day - day_anchor) % 7
			return WEEK_DAY_NAMES[week_day]


if __name__ == "__main__":
			import doctest

			doctest.testmod()