
"""simple docstring"""





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


_a														=		logging.get_logger(__name__)

_a														=		{
    """funnel-transformer/small""": """https://huggingface.co/funnel-transformer/small/resolve/main/config.json""",
    """funnel-transformer/small-base""": """https://huggingface.co/funnel-transformer/small-base/resolve/main/config.json""",
    """funnel-transformer/medium""": """https://huggingface.co/funnel-transformer/medium/resolve/main/config.json""",
    """funnel-transformer/medium-base""": """https://huggingface.co/funnel-transformer/medium-base/resolve/main/config.json""",
    """funnel-transformer/intermediate""": (
        """https://huggingface.co/funnel-transformer/intermediate/resolve/main/config.json"""
    ),
    """funnel-transformer/intermediate-base""": (
        """https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/config.json"""
    ),
    """funnel-transformer/large""": """https://huggingface.co/funnel-transformer/large/resolve/main/config.json""",
    """funnel-transformer/large-base""": """https://huggingface.co/funnel-transformer/large-base/resolve/main/config.json""",
    """funnel-transformer/xlarge""": """https://huggingface.co/funnel-transformer/xlarge/resolve/main/config.json""",
    """funnel-transformer/xlarge-base""": """https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/config.json""",
}






class     _UpperCAmelCase(    snake_case__	):
		lowercase__						=      'funnel'
		lowercase__						=      {
		    'hidden_size': 'd_model',
		    'num_attention_heads': 'n_head',
		}



		def __init__(					self				,		__a=3_05_22				,		__a=[4, 4, 4]				,		__a=None				,		__a=2				,		__a=7_68				,		__a=12				,		__a=64				,		__a=30_72				,		__a="gelu_new"				,		__a=0.1				,		__a=0.1				,		__a=0.0				,		__a=0.1				,		__a=None				,		__a=1e-9				,		__a="mean"				,		__a="relative_shift"				,		__a=True				,		__a=True				,		__a=True				,		**__a				,		)       ->       Dict:






							'''simple docstring'''
							_UpperCamelCase							 =  vocab_size
							_UpperCamelCase							 =  block_sizes
							_UpperCamelCase							 =  [1] * len(__a) if block_repeats is None else block_repeats
							assert len(__a) == len(
							    self.block_repeats), "`block_sizes` and `block_repeats` should have the same length."
							_UpperCamelCase							 =  num_decoder_layers
							_UpperCamelCase							 =  d_model
							_UpperCamelCase							 =  n_head
							_UpperCamelCase							 =  d_head
							_UpperCamelCase							 =  d_inner
							_UpperCamelCase							 =  hidden_act
							_UpperCamelCase							 =  hidden_dropout
							_UpperCamelCase							 =  attention_dropout
							_UpperCamelCase							 =  activation_dropout
							_UpperCamelCase							 =  initializer_range
							_UpperCamelCase							 =  initializer_std
							_UpperCamelCase							 =  layer_norm_eps
							assert pooling_type in [
							    "mean",
							    "max",
							], F'''Got {pooling_type} for `pooling_type` but only \'mean\' and \'max\' are supported.'''
							_UpperCamelCase							 =  pooling_type
							assert attention_type in [
							    "relative_shift",
							    "factorized",
							], F'''Got {attention_type} for `attention_type` but only \'relative_shift\' and \'factorized\' are supported.'''
							_UpperCamelCase							 =  attention_type
							_UpperCamelCase							 =  separate_cls
							_UpperCamelCase							 =  truncate_seq
							_UpperCamelCase							 =  pool_q_only

							super().__init__(**__a)



		@property
		def 						UpperCAmelCase							(					self)       ->       Any:






							'''simple docstring'''
							return sum(self.block_sizes)



		@num_hidden_layers.setter
		def 						UpperCAmelCase							(					self				,		__a)       ->       Dict:






							'''simple docstring'''
							raise NotImplementedError(
							    '''This model does not support the setting of `num_hidden_layers`. Please set `block_sizes`.''')



		@property
		def 						UpperCAmelCase							(					self)       ->       Dict:






							'''simple docstring'''
							return len(self.block_sizes)




		@num_blocks.setter
		def 						UpperCAmelCase							(					self				,		__a)       ->       str:






							'''simple docstring'''
							raise NotImplementedError('''This model does not support the setting of `num_blocks`. Please set `block_sizes`.''')














from __future__ import annotations

from itertools import permutations
from random import randint
from timeit import repeat


def __A    (      )->  tuple[list[int], int]:





						"""simple docstring"""



						_UpperCAmelCase									=			[randint(-1_000 ,		1_000	) for i in range(10	)]
						_UpperCAmelCase									=			randint(-5_000 ,		5_000	)
						return (arr, r)


_a      	=  make_dataset()


def __A    (      __lowerCAmelCase ,		__lowerCAmelCase	)->  tuple[int, ...]:





						"""simple docstring"""



						for triplet in permutations(__lowerCAmelCase ,		3	):
												if sum(__lowerCAmelCase	) == target:
																		return tuple(sorted(__lowerCAmelCase	)	)
						return (0, 0, 0)


def __A    (      __lowerCAmelCase ,		__lowerCAmelCase	)->  tuple[int, int, int]:





						"""simple docstring"""



						arr.sort()
						_UpperCAmelCase									=			len(__lowerCAmelCase	)
						for i in range(n - 1	):
												_UpperCAmelCase					, _UpperCAmelCase									=			i + 1, n - 1
												while left < right:
																		if arr[i] + arr[left] + arr[right] == target:
																								return (arr[i], arr[left], arr[right])
																		elif arr[i] + arr[left] + arr[right] < target:
																								left += 1
																		elif arr[i] + arr[left] + arr[right] > target:
																								right -= 1
						return (0, 0, 0)


def __A    (      )->  tuple[float, float]:





						"""simple docstring"""



						_UpperCAmelCase									=			'\nfrom __main__ import dataset, triplet_sum1, triplet_sum2\n'
						_UpperCAmelCase									=			'\ntriplet_sum1(*dataset)\n'
						_UpperCAmelCase									=			'\ntriplet_sum2(*dataset)\n'
						_UpperCAmelCase									=			repeat(setup=__lowerCAmelCase ,		stmt=__lowerCAmelCase ,		repeat=5 ,		number=10_000	)
						_UpperCAmelCase									=			repeat(setup=__lowerCAmelCase ,		stmt=__lowerCAmelCase ,		repeat=5 ,		number=10_000	)
						return (min(__lowerCAmelCase	), min(__lowerCAmelCase	))


if __name__ == "__main__":
		from doctest import testmod

		testmod()
		_a      	=  solution_times()
		print(F'''The time for naive implementation is {times[0]}.''')
		print(F'''The time for optimized implementation is {times[1]}.''')
