



'''simple docstring'''






from ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCamelCase__:   Optional[Any]								=			logging.get_logger(__name__)

UpperCamelCase__:   Optional[Any]								=			{
    "edbeeching/decision-transformer-gym-hopper-medium": (
        "https://huggingface.co/edbeeching/decision-transformer-gym-hopper-medium/resolve/main/config.json"
    ),
    # See all DecisionTransformer models at https://huggingface.co/models?filter=decision_transformer
}

class 				SCREAMING_SNAKE_CASE(							UpperCamelCase__			):







	"""simple docstring"""






	lowerCamelCase__			 =       '''decision_transformer'''
	lowerCamelCase__			 =       ['''past_key_values''']
	lowerCamelCase__			 =       {
	    '''max_position_embeddings''': '''n_positions''',
	    '''num_attention_heads''': '''n_head''',
	    '''num_hidden_layers''': '''n_layer''',
	}







	def __init__(						self			:     Dict		,			__snake_case			:     Tuple=17		,			__snake_case			:     Dict=4		,			__snake_case			:     Dict=128		,			__snake_case			:     Union[str, Any]=4096		,			__snake_case			:     int=True		,			__snake_case			:     Union[str, Any]=1		,			__snake_case			:     Tuple=1024		,			__snake_case			:     int=3		,			__snake_case			:     List[str]=1		,			__snake_case			:     Tuple=None		,			__snake_case			:     Any="relu"		,			__snake_case			:     int=0.1		,			__snake_case			:     Dict=0.1		,			__snake_case			:     Union[str, Any]=0.1		,			__snake_case			:     List[Any]=1E-5		,			__snake_case			:     List[str]=0.02		,			__snake_case			:     int=True		,			__snake_case			:     List[Any]=True		,			__snake_case			:     List[Any]=50256		,			__snake_case			:     Optional[int]=50256		,			__snake_case			:     str=False		,			__snake_case			:     Union[str, Any]=False		,			**__snake_case			:     Tuple		,			)			->		Optional[int]:
								UpperCAmelCase :       List[Any] 							=		state_dim
								UpperCAmelCase :       Union[str, Any] 							=		act_dim
								UpperCAmelCase :       int 							=		hidden_size
								UpperCAmelCase :       int 							=		max_ep_len
								UpperCAmelCase :       Any 							=		action_tanh
								UpperCAmelCase :       Tuple 							=		vocab_size
								UpperCAmelCase :       Tuple 							=		n_positions
								UpperCAmelCase :       Union[str, Any] 							=		n_layer
								UpperCAmelCase :       Any 							=		n_head
								UpperCAmelCase :       Any 							=		n_inner
								UpperCAmelCase :       Any 							=		activation_function
								UpperCAmelCase :       str 							=		resid_pdrop
								UpperCAmelCase :       List[str] 							=		embd_pdrop
								UpperCAmelCase :       Optional[int] 							=		attn_pdrop
								UpperCAmelCase :       List[str] 							=		layer_norm_epsilon
								UpperCAmelCase :       Optional[int] 							=		initializer_range
								UpperCAmelCase :       List[str] 							=		scale_attn_weights
								UpperCAmelCase :       Tuple 							=		use_cache
								UpperCAmelCase :       Optional[int] 							=		scale_attn_by_inverse_layer_idx
								UpperCAmelCase :       Any 							=		reorder_and_upcast_attn

								UpperCAmelCase :       Dict 							=		bos_token_id
								UpperCAmelCase :       Dict 							=		eos_token_id

								super().__init__(bos_token_id=UpperCamelCase_		,			eos_token_id=UpperCamelCase_		,			**UpperCamelCase_		)









def 			_a (      SCREAMING_SNAKE_CASE						,				SCREAMING_SNAKE_CASE						,				SCREAMING_SNAKE_CASE     ):


		"""simple docstring"""




		if exponent == 1:
				return base
		if exponent % 2 == 0:
				lowercase__            =      _modexpt(SCREAMING_SNAKE_CASE						,				exponent // 2						,				SCREAMING_SNAKE_CASE     ) % modulo_value
				return (x * x) % modulo_value
		else:
				return (base * _modexpt(SCREAMING_SNAKE_CASE						,				exponent - 1						,				SCREAMING_SNAKE_CASE     )) % modulo_value
def 			_a (      SCREAMING_SNAKE_CASE = 17_77						,				SCREAMING_SNAKE_CASE = 18_55						,				SCREAMING_SNAKE_CASE = 8     ):


		"""simple docstring"""




		lowercase__            =      base
		for _ in range(1						,				SCREAMING_SNAKE_CASE     ):
				lowercase__            =      _modexpt(SCREAMING_SNAKE_CASE						,				SCREAMING_SNAKE_CASE						,				10**digits     )

		return result


if __name__ == "__main__":
			print(f"""{solution() = }""")


