





"""simple docstring"""





from collections import OrderedDict
from typing import Any, Mapping, Optional, Union

from ...configuration_utils import PretrainedConfig
from ...feature_extraction_utils import FeatureExtractionMixin
from ...onnx import OnnxConfig
from ...onnx.utils import compute_effective_axis_dimension
from ...tokenization_utils_base import PreTrainedTokenizerBase
from ...utils import TensorType, logging


lowercase__				:Any				   =       logging.get_logger(__name__)

lowercase__				:Dict				   =       {
    'deepmind/language-perceiver': 'https://huggingface.co/deepmind/language-perceiver/resolve/main/config.json',
    # See all Perceiver models at https://huggingface.co/models?filter=perceiver
}




class 							snake_case							(			__UpperCAmelCase ):

      '''simple docstring'''



      _A     :       Optional[Any]         =       'perceiver'

      def __init__(							self       :      str						,				__lowercase       :      str=256						,				__lowercase       :      List[Any]=1_280						,				__lowercase       :      str=768						,				__lowercase       :      Union[str, Any]=1						,				__lowercase       :      Any=26						,				__lowercase       :      Tuple=8						,				__lowercase       :      Union[str, Any]=8						,				__lowercase       :      List[str]=None						,				__lowercase       :      Dict=None						,				__lowercase       :      Tuple="kv"						,				__lowercase       :      Union[str, Any]=1						,				__lowercase       :      Union[str, Any]=1						,				__lowercase       :      int="gelu"						,				__lowercase       :      str=0.1						,				__lowercase       :      Optional[int]=0.0_2						,				__lowercase       :      Optional[int]=1e-12						,				__lowercase       :      Tuple=True						,				__lowercase       :      Any=262						,				__lowercase       :      str=2_048						,				__lowercase       :      List[Any]=56						,				__lowercase       :      Any=[368, 496]						,				__lowercase       :      Any=16						,				__lowercase       :      Any=1_920						,				__lowercase       :      Union[str, Any]=16						,				__lowercase       :      Any=[1, 16, 224, 224]						,				**__lowercase       :      Tuple						,				):


        '''simple docstring'''




        super().__init__(**__lowercase )

        __UpperCAmelCase    :						Optional[int]       =						num_latents
        __UpperCAmelCase    :						Union[str, Any]       =						d_latents
        __UpperCAmelCase    :						Dict       =						d_model
        __UpperCAmelCase    :						int       =						num_blocks
        __UpperCAmelCase    :						str       =						num_self_attends_per_block
        __UpperCAmelCase    :						str       =						num_self_attention_heads
        __UpperCAmelCase    :						str       =						num_cross_attention_heads
        __UpperCAmelCase    :						Optional[Any]       =						qk_channels
        __UpperCAmelCase    :						Optional[int]       =						v_channels
        __UpperCAmelCase    :						str       =						cross_attention_shape_for_attention
        __UpperCAmelCase    :						List[str]       =						self_attention_widening_factor
        __UpperCAmelCase    :						Optional[Any]       =						cross_attention_widening_factor
        __UpperCAmelCase    :						Any       =						hidden_act
        __UpperCAmelCase    :						Optional[Any]       =						attention_probs_dropout_prob
        __UpperCAmelCase    :						Optional[int]       =						initializer_range
        __UpperCAmelCase    :						List[Any]       =						layer_norm_eps
        __UpperCAmelCase    :						Any       =						use_query_residual
        # masked language modeling attributes
        __UpperCAmelCase    :						int       =						vocab_size
        __UpperCAmelCase    :						Any       =						max_position_embeddings
        # image classification attributes
        __UpperCAmelCase    :						Tuple       =						image_size
        # flow attributes
        __UpperCAmelCase    :						Any       =						train_size
        # multimodal autoencoding attributes
        __UpperCAmelCase    :						Optional[int]       =						num_frames
        __UpperCAmelCase    :						Tuple       =						audio_samples_per_frame
        __UpperCAmelCase    :						Optional[int]       =						samples_per_patch
        __UpperCAmelCase    :						Any       =						output_shape




class 							snake_case							(			__UpperCAmelCase ):

      '''simple docstring'''



      @property
      def       A_					(							self       :      Optional[int] ):


        '''simple docstring'''




        if self.task == "multiple-choice":
          __UpperCAmelCase    :						int       =						{0: '''batch''', 1: '''choice''', 2: '''sequence'''}
        else:
          __UpperCAmelCase    :						List[Any]       =						{0: '''batch''', 1: '''sequence'''}
        return OrderedDict(
            [
                ('''inputs''', dynamic_axis),
                ('''attention_mask''', dynamic_axis),
            ] )

      @property
      def       A_					(							self       :      Union[str, Any] ):


        '''simple docstring'''




        return 1e-4







      def       A_					(							self       :      str						,				__lowercase       :      Union["PreTrainedTokenizerBase", "FeatureExtractionMixin"]						,				__lowercase       :      int = -1						,				__lowercase       :      int = -1						,				__lowercase       :      int = -1						,				__lowercase       :      bool = False						,				__lowercase       :      Optional[TensorType] = None						,				__lowercase       :      int = 3						,				__lowercase       :      int = 40						,				__lowercase       :      int = 40						,				):


        '''simple docstring'''




        if isinstance(__lowercase						,				__lowercase ):
          # If dynamic axis (-1) we forward with a fixed dimension of 2 samples to avoid optimizations made by ONNX
          __UpperCAmelCase    :						Optional[int]       =						compute_effective_axis_dimension(
              __lowercase						,				fixed_dimension=OnnxConfig.default_fixed_batch						,				num_token_to_add=0 )
          # If dynamic axis (-1) we forward with a fixed dimension of 8 tokens to avoid optimizations made by ONNX
          __UpperCAmelCase    :						str       =						preprocessor.num_special_tokens_to_add(__lowercase )
          __UpperCAmelCase    :						Optional[int]       =						compute_effective_axis_dimension(
              __lowercase						,				fixed_dimension=OnnxConfig.default_fixed_sequence						,				num_token_to_add=__lowercase )
          # Generate dummy inputs according to compute batch and sequence
          __UpperCAmelCase    :						Tuple       =						[''' '''.join(['''a'''] ) * seq_length] * batch_size
          __UpperCAmelCase    :						Dict       =						dict(preprocessor(__lowercase						,				return_tensors=__lowercase ) )
          __UpperCAmelCase    :						List[str]       =						inputs.pop('''input_ids''' )
          return inputs
        elif isinstance(__lowercase						,				__lowercase ) and preprocessor.model_input_names[0] == "pixel_values":
          # If dynamic axis (-1) we forward with a fixed dimension of 2 samples to avoid optimizations made by ONNX
          __UpperCAmelCase    :						Dict       =						compute_effective_axis_dimension(__lowercase						,				fixed_dimension=OnnxConfig.default_fixed_batch )
          __UpperCAmelCase    :						Optional[Any]       =						self._generate_dummy_images(__lowercase						,				__lowercase						,				__lowercase						,				__lowercase )
          __UpperCAmelCase    :						int       =						dict(preprocessor(images=__lowercase						,				return_tensors=__lowercase ) )
          __UpperCAmelCase    :						int       =						inputs.pop('''pixel_values''' )
          return inputs
        else:
          raise ValueError(
              '''Unable to generate dummy inputs for the model. Please provide a tokenizer or a preprocessor.''' )






"""simple docstring"""





def       lowerCamelCase_       (   )						->str:





  """simple docstring"""


  for n in range(1  ,			1_00_00_00  ):
    yield n * (n + 1) // 2


def       lowerCamelCase_       (   UpperCAmelCase_  )						->Union[str, Any]:





  """simple docstring"""


  __UpperCAmelCase    :						Dict       =						1
  __UpperCAmelCase    :						Any       =						2
  while i * i <= n:
    __UpperCAmelCase    :						Tuple       =						0
    while n % i == 0:
      n //= i
      multiplicity += 1
    divisors_count *= multiplicity + 1
    i += 1
  if n > 1:
    divisors_count *= 2
  return divisors_count


def       lowerCamelCase_       (   )						->Optional[int]:





  """simple docstring"""


  return next(i for i in triangle_number_generator() if count_divisors(UpperCAmelCase_  ) > 5_00  )


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