


'''simple docstring'''
import operator as op


UpperCamelCase__          = '''scaler.pt'''
UpperCamelCase__          = '''pytorch_model'''
UpperCamelCase__          = '''random_states'''
UpperCamelCase__          = '''optimizer'''
UpperCamelCase__          = '''scheduler'''
UpperCamelCase__          = '''pytorch_model.bin'''
UpperCamelCase__          = '''pytorch_model.bin.index.json'''
UpperCamelCase__          = '''model.safetensors'''
UpperCamelCase__          = '''model.safetensors.index.json'''
UpperCamelCase__          = '''1.10.2'''
UpperCamelCase__          = '''py38'''
UpperCamelCase__          = '''4.17.0'''
UpperCamelCase__          = ['''ml.p3.16xlarge''', '''ml.p3dn.24xlarge''', '''ml.p4dn.24xlarge''']
UpperCamelCase__          = ['''FULL_SHARD''', '''SHARD_GRAD_OP''', '''NO_SHARD''', '''HYBRID_SHARD''', '''HYBRID_SHARD_ZERO2''']
UpperCamelCase__          = ['''TRANSFORMER_BASED_WRAP''', '''SIZE_BASED_WRAP''', '''NO_WRAP''']
UpperCamelCase__          = ['''BACKWARD_PRE''', '''BACKWARD_POST''', '''NO_PREFETCH''']
UpperCamelCase__          = ['''FULL_STATE_DICT''', '''LOCAL_STATE_DICT''', '''SHARDED_STATE_DICT''']
UpperCamelCase__          = '''2.0.1'''
UpperCamelCase__          = ['''pdsh''', '''standard''', '''openmpi''', '''mvapich''']
UpperCamelCase__          = ['''default''', '''reduce-overhead''', '''max-autotune''']

UpperCamelCase__          = {'''>''': op.gt, '''>=''': op.ge, '''==''': op.eq, '''!=''': op.ne, '''<=''': op.le, '''<''': op.lt}

# These are the args for `torch.distributed.launch` for pytorch < 1.9
UpperCamelCase__          = [
    '''nnodes''',
    '''nproc_per_node''',
    '''rdzv_backend''',
    '''rdzv_endpoint''',
    '''rdzv_id''',
    '''rdzv_conf''',
    '''standalone''',
    '''max_restarts''',
    '''monitor_interval''',
    '''start_method''',
    '''role''',
    '''module''',
    '''m''',
    '''no_python''',
    '''run_path''',
    '''log_dir''',
    '''r''',
    '''redirects''',
    '''t''',
    '''tee''',
    '''node_rank''',
    '''master_addr''',
    '''master_port''',
]

UpperCamelCase__          = ['''DEEPSPEED''', '''MULTI_GPU''', '''FSDP''', '''MEGATRON_LM''']
UpperCamelCase__          = ['''DEEPSPEED''', '''MULTI_XPU''', '''FSDP''']


'''simple docstring'''



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


_lowercase          =						logging.get_logger(__name__)

_lowercase          =						{
    """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     UpperCAmelCase_	(						_SCREAMING_SNAKE_CASE					):






						'''simple docstring'''






						_lowercase						: List[str]										=  '''decision_transformer'''
						_lowercase						: Optional[Any]										=  ['''past_key_values''']
						_lowercase						: str										=  {
						    '''max_position_embeddings''': '''n_positions''',
						    '''num_attention_heads''': '''n_head''',
						    '''num_hidden_layers''': '''n_layer''',
						}




						def __init__(   self       ,  _lowercase=17       ,  _lowercase=4       ,  _lowercase=128       ,  _lowercase=4_096       ,  _lowercase=True       ,  _lowercase=1       ,  _lowercase=1_024       ,  _lowercase=3       ,  _lowercase=1       ,  _lowercase=None       ,  _lowercase="relu"       ,  _lowercase=0.1       ,  _lowercase=0.1       ,  _lowercase=0.1       ,  _lowercase=1e-5       ,  _lowercase=0.02       ,  _lowercase=True       ,  _lowercase=True       ,  _lowercase=50_256       ,  _lowercase=50_256       ,  _lowercase=False       ,  _lowercase=False       ,  **_lowercase       ,  ):

												"""simple docstring"""



												_lowerCAmelCase    		=					state_dim
												_lowerCAmelCase    		=					act_dim
												_lowerCAmelCase    		=					hidden_size
												_lowerCAmelCase    		=					max_ep_len
												_lowerCAmelCase    		=					action_tanh
												_lowerCAmelCase    		=					vocab_size
												_lowerCAmelCase    		=					n_positions
												_lowerCAmelCase    		=					n_layer
												_lowerCAmelCase    		=					n_head
												_lowerCAmelCase    		=					n_inner
												_lowerCAmelCase    		=					activation_function
												_lowerCAmelCase    		=					resid_pdrop
												_lowerCAmelCase    		=					embd_pdrop
												_lowerCAmelCase    		=					attn_pdrop
												_lowerCAmelCase    		=					layer_norm_epsilon
												_lowerCAmelCase    		=					initializer_range
												_lowerCAmelCase    		=					scale_attn_weights
												_lowerCAmelCase    		=					use_cache
												_lowerCAmelCase    		=					scale_attn_by_inverse_layer_idx
												_lowerCAmelCase    		=					reorder_and_upcast_attn

												_lowerCAmelCase    		=					bos_token_id
												_lowerCAmelCase    		=					eos_token_id

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