"""simple docstring"""






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

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import TensorType, logging


if TYPE_CHECKING:
       from ...onnx.config import PatchingSpec
       from ...tokenization_utils_base import PreTrainedTokenizerBase


__lowerCAmelCase					: Tuple        =logging.get_logger(__name__)

__lowerCAmelCase					: Union[str, Any]        ={
    """allenai/longformer-base-4096""": """https://huggingface.co/allenai/longformer-base-4096/resolve/main/config.json""",
    """allenai/longformer-large-4096""": """https://huggingface.co/allenai/longformer-large-4096/resolve/main/config.json""",
    """allenai/longformer-large-4096-finetuned-triviaqa""": (
        """https://huggingface.co/allenai/longformer-large-4096-finetuned-triviaqa/resolve/main/config.json"""
    ),
    """allenai/longformer-base-4096-extra.pos.embd.only""": (
        """https://huggingface.co/allenai/longformer-base-4096-extra.pos.embd.only/resolve/main/config.json"""
    ),
    """allenai/longformer-large-4096-extra.pos.embd.only""": (
        """https://huggingface.co/allenai/longformer-large-4096-extra.pos.embd.only/resolve/main/config.json"""
    ),
}





class 				_A		( lowerCAmelCase			):
      snake_case__    :     Union[str, Any]													=			'longformer'

      def __init__(		self	, __lowerCAmelCase = 512	, __lowerCAmelCase = 2	, __lowerCAmelCase = 1	, __lowerCAmelCase = 0	, __lowerCAmelCase = 2	, __lowerCAmelCase = 3_0522	, __lowerCAmelCase = 768	, __lowerCAmelCase = 12	, __lowerCAmelCase = 12	, __lowerCAmelCase = 3072	, __lowerCAmelCase = "gelu"	, __lowerCAmelCase = 0.1	, __lowerCAmelCase = 0.1	, __lowerCAmelCase = 512	, __lowerCAmelCase = 2	, __lowerCAmelCase = 0.0_2	, __lowerCAmelCase = 1E-12	, __lowerCAmelCase = False	, **__lowerCAmelCase	, ):







            """simple docstring"""



            super().__init__(pad_token_id=__lowerCAmelCase	, **__lowerCAmelCase		)

            lowercase														=			attention_window
            lowercase														=			sep_token_id
            lowercase														=			bos_token_id
            lowercase														=			eos_token_id
            lowercase														=			vocab_size
            lowercase														=			hidden_size
            lowercase														=			num_hidden_layers
            lowercase														=			num_attention_heads
            lowercase														=			hidden_act
            lowercase														=			intermediate_size
            lowercase														=			hidden_dropout_prob
            lowercase														=			attention_probs_dropout_prob
            lowercase														=			max_position_embeddings
            lowercase														=			type_vocab_size
            lowercase														=			initializer_range
            lowercase														=			layer_norm_eps
            lowercase														=			onnx_export






class 				_A		( lowerCAmelCase			):

      def __init__(		self	, __lowerCAmelCase	, __lowerCAmelCase = "default"	, __lowerCAmelCase = None		):







            """simple docstring"""



            super().__init__(__lowerCAmelCase	, __lowerCAmelCase	, __lowerCAmelCase		)
            lowercase														=			True

      @property
      def        A__ (		self		):







            """simple docstring"""



            if self.task == "multiple-choice":
                  lowercase														=			{0: """batch""", 1: """choice""", 2: """sequence"""}
            else:
                  lowercase														=			{0: """batch""", 1: """sequence"""}
            return OrderedDict(
                [
                    ("""input_ids""", dynamic_axis),
                    ("""attention_mask""", dynamic_axis),
                    ("""global_attention_mask""", dynamic_axis),
                ]		)

      @property
      def        A__ (		self		):







            """simple docstring"""



            lowercase														=			super().outputs
            if self.task == "default":
                  lowercase														=			{0: """batch"""}
            return outputs

      @property
      def        A__ (		self		):







            """simple docstring"""



            return 1E-4

      @property
      def        A__ (		self		):







            """simple docstring"""



            return max(super().default_onnx_opset	, 14		)







      def        A__ (		self	, __lowerCAmelCase	, __lowerCAmelCase = -1	, __lowerCAmelCase = -1	, __lowerCAmelCase = False	, __lowerCAmelCase = None	, ):







            """simple docstring"""



            lowercase														=			super().generate_dummy_inputs(
                preprocessor=__lowerCAmelCase	, batch_size=__lowerCAmelCase	, seq_length=__lowerCAmelCase	, is_pair=__lowerCAmelCase	, framework=__lowerCAmelCase		)
            import torch

            # for some reason, replacing this code by inputs["global_attention_mask"] = torch.randint(2, inputs["input_ids"].shape, dtype=torch.int64)
            # makes the export fail randomly
            lowercase														=			torch.zeros_like(inputs["""input_ids"""]		)
            # make every second token global
            lowercase														=			1

            return inputs




"""simple docstring"""






def     UpperCAmelCase__ (       lowerCAmelCase__  :int	)				->					bool:
      '''simple docstring'''


      lowercase														=			(1 + 2_4 * n) ** 0.5
      return ((1 + root) / 6) % 1 == 0


def     UpperCAmelCase__ (       lowerCAmelCase__  :int = 5_0_0_0	)				->					int:
      '''simple docstring'''


      lowercase														=			[(i * (3 * i - 1)) // 2 for i in range(1      ,	lowerCAmelCase__	)]
      for i, pentagonal_i in enumerate(lowerCAmelCase__	):
            for j in range(lowerCAmelCase__      ,	len(lowerCAmelCase__	)	):
                  lowercase														=			pentagonal_nums[j]
                  lowercase														=			pentagonal_i + pentagonal_j
                  lowercase														=			pentagonal_j - pentagonal_i
                  if is_pentagonal(lowerCAmelCase__	) and is_pentagonal(lowerCAmelCase__	):
                        return b

      return -1


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



