


'''simple docstring'''
from collections import OrderedDict
from typing import Any, List, Mapping, Optional

from ... import PreTrainedTokenizer, TensorType, is_torch_available
from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfigWithPast, PatchingSpec
from ...utils import logging


UpperCamelCase__    					=      logging.get_logger(__name__)

UpperCamelCase__    					=      {
    '''EleutherAI/gpt-j-6B''': '''https://huggingface.co/EleutherAI/gpt-j-6B/resolve/main/config.json''',
    # See all GPT-J models at https://huggingface.co/models?filter=gpt_j
}




class 			lowerCamelCase_   (	_UpperCAmelCase      ):
      lowerCAmelCase__		     =     "gptj"
      lowerCAmelCase__		     =     {
          "max_position_embeddings": "n_positions",
          "hidden_size": "n_embd",
          "num_attention_heads": "n_head",
          "num_hidden_layers": "n_layer",
      }






      def __init__(					self				:    List[str]						,						_A				:    Tuple=50_400						,						_A				:    Dict=2_048						,						_A				:    Optional[int]=4_096						,						_A				:    Optional[int]=28						,						_A				:    str=16						,						_A				:    Optional[int]=64						,						_A				:    List[Any]=None						,						_A				:    List[str]="gelu_new"						,						_A				:    Optional[Any]=0.0						,						_A				:    int=0.0						,						_A				:    Any=0.0						,						_A				:    Union[str, Any]=1e-5						,						_A				:    Optional[Any]=0.0_2						,						_A				:    Any=True						,						_A				:    int=50_256						,						_A				:    Any=50_256						,						_A				:    Dict=False						,						**_A				:    Union[str, Any]						,						):


          '''simple docstring'''


          UpperCAmelCase__			:		Optional[int]													=				vocab_size
          UpperCAmelCase__			:		int													=				n_positions
          UpperCAmelCase__			:		Optional[Any]													=				n_embd
          UpperCAmelCase__			:		Dict													=				n_layer
          UpperCAmelCase__			:		str													=				n_head
          UpperCAmelCase__			:		int													=				n_inner
          UpperCAmelCase__			:		Tuple													=				rotary_dim
          UpperCAmelCase__			:		Any													=				activation_function
          UpperCAmelCase__			:		Optional[Any]													=				resid_pdrop
          UpperCAmelCase__			:		str													=				embd_pdrop
          UpperCAmelCase__			:		Union[str, Any]													=				attn_pdrop
          UpperCAmelCase__			:		str													=				layer_norm_epsilon
          UpperCAmelCase__			:		str													=				initializer_range
          UpperCAmelCase__			:		str													=				use_cache

          UpperCAmelCase__			:		Optional[int]													=				bos_token_id
          UpperCAmelCase__			:		str													=				eos_token_id

          super().__init__(
              bos_token_id=_UpperCAmelCase						,						eos_token_id=_UpperCAmelCase						,						tie_word_embeddings=_UpperCAmelCase						,						**_UpperCAmelCase )




class 			lowerCamelCase_   (	_UpperCAmelCase      ):






      def __init__(					self				:    Tuple						,						_A				:    Dict						,						_A				:    List[Any] = "default"						,						_A				:    str = None						,						_A				:    Tuple = False						,						):


          '''simple docstring'''


          super().__init__(_UpperCAmelCase						,						task=_UpperCAmelCase						,						patching_specs=_UpperCAmelCase						,						use_past=_UpperCAmelCase )
          if not getattr(self._config						,						'''pad_token_id'''						,						_UpperCAmelCase ):
              # TODO: how to do that better?
              UpperCAmelCase__			:		Any													=				0






      @property
      def lowercase_							(					self				:    Any ):


          '''simple docstring'''


          UpperCAmelCase__			:		int													=				OrderedDict({'''input_ids''': {0: '''batch''', 1: '''sequence'''}} )
          if self.use_past:
              self.fill_with_past_key_values_(_UpperCAmelCase						,						direction='''inputs''' )
              UpperCAmelCase__			:		List[Any]													=				{0: '''batch''', 1: '''past_sequence + sequence'''}
          else:
              UpperCAmelCase__			:		Any													=				{0: '''batch''', 1: '''sequence'''}

          return common_inputs






      @property
      def lowercase_							(					self				:    Dict ):


          '''simple docstring'''


          return self._config.n_layer






      @property
      def lowercase_							(					self				:    str ):


          '''simple docstring'''


          return self._config.n_head






      def lowercase_							(					self				:    Optional[Any]						,						_A				:    List[str]						,						_A				:    Dict = -1						,						_A				:    Tuple = -1						,						_A				:    List[str] = False						,						_A				:    Tuple = None						,						):


          '''simple docstring'''


          UpperCAmelCase__			:		List[Any]													=				super(_UpperCAmelCase						,						self ).generate_dummy_inputs(
              _UpperCAmelCase						,						batch_size=_UpperCAmelCase						,						seq_length=_UpperCAmelCase						,						is_pair=_UpperCAmelCase						,						framework=_UpperCAmelCase )

          # We need to order the input in the way they appears in the forward()
          UpperCAmelCase__			:		Optional[Any]													=				OrderedDict({'''input_ids''': common_inputs['''input_ids''']} )

          # Need to add the past_keys
          if self.use_past:
              if not is_torch_available():
                  raise ValueError('''Cannot generate dummy past_keys inputs without PyTorch installed.''' )
              else:
                  import torch

                  UpperCAmelCase__			:		Tuple													=				common_inputs['''input_ids'''].shape
                  # Not using the same length for past_key_values
                  UpperCAmelCase__			:		Any													=				seqlen + 2
                  UpperCAmelCase__			:		Any													=				(
                      batch,
                      self.num_attention_heads,
                      past_key_values_length,
                      self._config.hidden_size // self.num_attention_heads,
                  )
                  UpperCAmelCase__			:		Dict													=				[
                      (torch.zeros(_UpperCAmelCase ), torch.zeros(_UpperCAmelCase )) for _ in range(self.num_layers )
                  ]

          UpperCAmelCase__			:		List[str]													=				common_inputs['''attention_mask''']
          if self.use_past:
              UpperCAmelCase__			:		Union[str, Any]													=				ordered_inputs['''attention_mask'''].dtype
              UpperCAmelCase__			:		List[Any]													=				torch.cat(
                  [ordered_inputs['''attention_mask'''], torch.ones(_UpperCAmelCase						,						_UpperCAmelCase						,						dtype=_UpperCAmelCase )]						,						dim=1 )

          return ordered_inputs






      @property
      def lowercase_							(					self				:    List[Any] ):


          '''simple docstring'''


          return 13

"""simple docstring"""






def SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase=2_8_1_2_3 )  ->  Any:
   lowercase__:   Optional[Any]					=      [1] * (limit + 1)

   for i in range(2       ,    int(limit**0.5 ) + 1 ):
      sum_divs[i * i] += i
      for k in range(i + 1       ,    limit // i + 1 ):
         sum_divs[k * i] += k + i

   lowercase__:   Union[str, Any]					=      set()
   lowercase__:   Optional[Any]					=      0

   for n in range(1       ,    limit + 1 ):
      if sum_divs[n] > n:
         abundants.add(__UpperCAmelCase )

      if not any((n - a in abundants) for a in abundants ):
         res += n

   return res


if __name__ == "__main__":
       print(solution())
