

from collections import OrderedDict
from typing import Mapping

from packaging import version

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


lowerCAmelCase__		      =       logging.get_logger(__name__)

lowerCAmelCase__		      =       {
    """facebook/data2vec-vision-base-ft""": (
        """https://huggingface.co/facebook/data2vec-vision-base-ft/resolve/main/config.json"""
    ),
}

class     a__  (    __UpperCamelCase	):
			"""simple docstring"""







			__lowerCamelCase       				=				'data2vec-vision'


			def __init__(			self					,					lowercase=768					,					lowercase=12					,					lowercase=12					,					lowercase=3072					,					lowercase="gelu"					,					lowercase=0.0					,					lowercase=0.0					,					lowercase=0.02					,					lowercase=1e-12					,					lowercase=224					,					lowercase=16					,					lowercase=3					,					lowercase=False					,					lowercase=False					,					lowercase=False					,					lowercase=False					,					lowercase=0.1					,					lowercase=0.1					,					lowercase=True					,					lowercase=[3, 5, 7, 11]					,					lowercase=[1, 2, 3, 6]					,					lowercase=True					,					lowercase=0.4					,					lowercase=256					,					lowercase=1					,					lowercase=False					,					lowercase=255					,					**lowercase					,					)     ->  List[str]:
							'''simple docstring'''






							super().__init__(**lowerCAmelCase__				)

							A__						=	hidden_size
							A__						=	num_hidden_layers
							A__						=	num_attention_heads
							A__						=	intermediate_size
							A__						=	hidden_act
							A__						=	hidden_dropout_prob
							A__						=	attention_probs_dropout_prob
							A__						=	initializer_range
							A__						=	layer_norm_eps

							A__						=	image_size
							A__						=	patch_size
							A__						=	num_channels
							A__						=	use_mask_token
							A__						=	use_absolute_position_embeddings
							A__						=	use_relative_position_bias
							A__						=	use_shared_relative_position_bias
							A__						=	layer_scale_init_value
							A__						=	drop_path_rate
							A__						=	use_mean_pooling
							# decode head attributes (semantic segmentation)
							A__						=	out_indices
							A__						=	pool_scales
							# auxiliary head attributes (semantic segmentation)
							A__						=	use_auxiliary_head
							A__						=	auxiliary_loss_weight
							A__						=	auxiliary_channels
							A__						=	auxiliary_num_convs
							A__						=	auxiliary_concat_input
							A__						=	semantic_loss_ignore_index

class     a__  (    __UpperCamelCase	):
			"""simple docstring"""







			__lowerCamelCase       				=				version.parse('1.11'	)


			@property
			def    UpperCamelCase						(			self				)     ->  Mapping[str, Mapping[int, str]]:
							'''simple docstring'''






							return OrderedDict(
							    [
							        ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
							    ]				)


			@property
			def    UpperCamelCase						(			self				)     ->  float:
							'''simple docstring'''






							return 1e-4





__lowerCAmelCase		       =							range(2, 20 + 1)
__lowerCAmelCase		       =							[10**k for k in range(ks[-1] + 1)]
__lowerCAmelCase		       =							{}




def    snake_case_     (  snake_case			,							snake_case			,							snake_case			,							snake_case     )  ->				Optional[int]:
       lowercase__:   str  			=   sum(a_i[j] for j in range(snake_case			,							len(snake_case     )     )     )
       lowercase__:   Optional[int]  			=   sum(a_i[j] * base[j] for j in range(min(len(snake_case     )			,							snake_case     )     )     )

       lowercase__			,						lowercase__:   str  			=   0, 0
       lowercase__:   Tuple  			=   n - i

       lowercase__:   Dict  			=   memo.get(snake_case     )

       if sub_memo is not None:
              lowercase__:   Optional[Any]  			=   sub_memo.get(snake_case     )

              if jumps is not None and len(snake_case     ) > 0:
                     # find and make the largest jump without going over
                     lowercase__:   int  			=   -1
                     for _k in range(len(snake_case     ) - 1			,							-1			,							-1     ):
                            if jumps[_k][2] <= k and jumps[_k][1] <= max_dn:
                                   lowercase__:   Union[str, Any]  			=   _k
                                   break

                     if max_jump >= 0:
                            lowercase__			,						lowercase__			,						lowercase__:   Any  			=   jumps[max_jump]
                            # since the difference between jumps is cached, add c
                            lowercase__:   str  			=   diff + c
                            for j in range(min(snake_case			,							len(snake_case     )     )     ):
                                   lowercase__			,						lowercase__:   Dict  			=   divmod(snake_case			,							10     )
                            if new_c > 0:
                                   add(snake_case			,							snake_case			,							snake_case     )

              else:
                     lowercase__:   List[Any]  			=   []
       else:
              lowercase__:   Optional[Any]  			=   {c: []}
              lowercase__:   Union[str, Any]  			=   sub_memo

       if dn >= max_dn or c + diff >= base[k]:
              return diff, dn

       if k > ks[0]:
              while True:
                     # keep doing smaller jumps
                     lowercase__			,						lowercase__:   Union[str, Any]  			=   next_term(snake_case			,							k - 1			,							i + dn			,							snake_case     )
                     diff += _diff
                     dn += terms_jumped

                     if dn >= max_dn or c + diff >= base[k]:
                            break
       else:
              # would be too small a jump, just compute sequential terms instead
              lowercase__			,						lowercase__:   Dict  			=   compute(snake_case			,							snake_case			,							i + dn			,							snake_case     )
              diff += _diff
              dn += terms_jumped

       lowercase__:   Any  			=   sub_memo[c]

       # keep jumps sorted by # of terms skipped
       lowercase__:   str  			=   0
       while j < len(snake_case     ):
              if jumps[j][1] > dn:
                     break
              j += 1

       # cache the jump for this value digitsum(b) and c
       sub_memo[c].insert(snake_case			,							(diff, dn, k)     )
       return (diff, dn)




def    snake_case_     (  snake_case			,							snake_case			,							snake_case			,							snake_case     )  ->				str:
       if i >= n:
              return 0, i
       if k > len(snake_case     ):
              a_i.extend([0 for _ in range(k - len(snake_case     )     )]     )

       # note: a_i -> b * 10^k + c
       # ds_b -> digitsum(b)
       # ds_c -> digitsum(c)
       lowercase__:   List[Any]  			=   i
       lowercase__			,						lowercase__			,						lowercase__:   Any  			=   0, 0, 0
       for j in range(len(snake_case     )     ):
              if j >= k:
                     ds_b += a_i[j]
              else:
                     ds_c += a_i[j]

       while i < n:
              i += 1
              lowercase__:   str  			=   ds_c + ds_b
              diff += addend
              lowercase__:   List[str]  			=   0
              for j in range(snake_case     ):
                     lowercase__:   Any  			=   a_i[j] + addend
                     lowercase__			,						lowercase__:   List[Any]  			=   divmod(snake_case			,							10     )

                     ds_c += a_i[j]

              if addend > 0:
                     break

       if addend > 0:
              add(snake_case			,							snake_case			,							snake_case     )
       return diff, i - start_i




def    snake_case_     (  snake_case			,							snake_case			,							snake_case     )  ->				int:
       for j in range(snake_case			,							len(snake_case     )     ):
              lowercase__:   str  			=   digits[j] + addend
              if s >= 10:
                     lowercase__			,						lowercase__:   Any  			=   divmod(snake_case			,							10     )
                     lowercase__:   Any  			=   addend // 10 + quotient
              else:
                     lowercase__:   Union[str, Any]  			=   s
                     lowercase__:   Union[str, Any]  			=   addend // 10

              if addend == 0:
                     break

       while addend > 0:
              lowercase__			,						lowercase__:   Union[str, Any]  			=   divmod(snake_case			,							10     )
              digits.append(snake_case     )




def    snake_case_     (  snake_case = 10**15     )  ->				int:
       lowercase__:   Optional[Any]  			=   [1]
       lowercase__:   int  			=   1
       lowercase__:   Tuple  			=   0
       while True:
              lowercase__			,						lowercase__:   str  			=   next_term(snake_case			,							20			,							i + dn			,							snake_case     )
              dn += terms_jumped
              if dn == n - i:
                     break

       lowercase__:   Dict  			=   0
       for j in range(len(snake_case     )     ):
              a_n += digits[j] * 10**j
       return a_n


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


