



"""simple docstring"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


A:   Optional[int]								=		logging.get_logger(__name__)

A:   List[Any]								=		{
    "google/bit-50": "https://huggingface.co/google/bit-50/resolve/main/config.json",
}



class       SCREAMING_SNAKE_CASE__  (					UpperCAmelCase__      ,			UpperCAmelCase__ ):
   __lowerCAmelCase  :   Optional[int]						=						'bit'
   __lowerCAmelCase  :   Union[str, Any]						=						['preactivation', 'bottleneck']
   __lowerCAmelCase  :   Union[str, Any]						=						['SAME', 'VALID']

   def __init__(   self      ,     _SCREAMING_SNAKE_CASE=3      ,     _SCREAMING_SNAKE_CASE=64      ,     _SCREAMING_SNAKE_CASE=[256, 512, 1024, 2048]      ,     _SCREAMING_SNAKE_CASE=[3, 4, 6, 3]      ,     _SCREAMING_SNAKE_CASE="preactivation"      ,     _SCREAMING_SNAKE_CASE="relu"      ,     _SCREAMING_SNAKE_CASE=None      ,     _SCREAMING_SNAKE_CASE=32      ,     _SCREAMING_SNAKE_CASE=0.0      ,     _SCREAMING_SNAKE_CASE=False      ,     _SCREAMING_SNAKE_CASE=32      ,     _SCREAMING_SNAKE_CASE=1      ,     _SCREAMING_SNAKE_CASE=None      ,     _SCREAMING_SNAKE_CASE=None      ,     **_SCREAMING_SNAKE_CASE      ,     )  ->      int:





    '''simple docstring'''




    super().__init__(**_SCREAMING_SNAKE_CASE						)
    if layer_type not in self.layer_types:
     raise ValueError(F"layer_type={layer_type} is not one of {','.join(self.layer_types						)}"						)
    if global_padding is not None:
     if global_padding.upper() in self.supported_padding:
      UpperCAmelCase	:					List[str]	=	global_padding.upper()
     else:
      raise ValueError(F"Padding strategy {global_padding} not supported"						)
    UpperCAmelCase	:					Optional[Any]	=	num_channels
    UpperCAmelCase	:					Optional[int]	=	embedding_size
    UpperCAmelCase	:					List[str]	=	hidden_sizes
    UpperCAmelCase	:					int	=	depths
    UpperCAmelCase	:					Tuple	=	layer_type
    UpperCAmelCase	:					Tuple	=	hidden_act
    UpperCAmelCase	:					Optional[int]	=	global_padding
    UpperCAmelCase	:					Any	=	num_groups
    UpperCAmelCase	:					Any	=	drop_path_rate
    UpperCAmelCase	:					List[str]	=	embedding_dynamic_padding
    UpperCAmelCase	:					Dict	=	output_stride
    UpperCAmelCase	:					Union[str, Any]	=	width_factor

    UpperCAmelCase	:					Tuple	=	["""stem"""] + [F"stage{idx}" for idx in range(1      ,     len(_SCREAMING_SNAKE_CASE						) + 1						)]
    UpperCAmelCase	,		UpperCAmelCase	:					Optional[Any]	=	get_aligned_output_features_output_indices(
        out_features=_SCREAMING_SNAKE_CASE      ,     out_indices=_SCREAMING_SNAKE_CASE      ,     stage_names=self.stage_names						)






'''simple docstring'''

# tests directory-specific settings - this file is run automatically
# by pytest before any tests are run

import doctest
import sys
import warnings
from os.path import abspath, dirname, join

import _pytest

from transformers.testing_utils import HfDoctestModule, HfDocTestParser


# allow having multiple repository checkouts and not needing to remember to rerun
# 'pip install -e .[dev]' when switching between checkouts and running tests.
a  :				int									=  abspath(join(dirname(__file__), 'src'))
sys.path.insert(1, git_repo_path)

# silence FutureWarning warnings in tests since often we can't act on them until
# they become normal warnings - i.e. the tests still need to test the current functionality
warnings.simplefilter(action='ignore', category=FutureWarning)


def 		__magic_name__    (	__UpperCAmelCase	)		->					Optional[int]:

					'''simple docstring'''

					config.addinivalue_line(
					    '''markers''',      '''is_pt_tf_cross_test: mark test to run only when PT and TF interactions are tested'''	)
					config.addinivalue_line(
					    '''markers''',      '''is_pt_flax_cross_test: mark test to run only when PT and FLAX interactions are tested'''	)
					config.addinivalue_line('''markers''',      '''is_pipeline_test: mark test to run only when pipelines are tested'''	)
					config.addinivalue_line('''markers''',      '''is_staging_test: mark test to run only in the staging environment'''	)
					config.addinivalue_line('''markers''',      '''accelerate_tests: mark test that require accelerate'''	)
					config.addinivalue_line('''markers''',      '''tool_tests: mark the tool tests that are run on their specific schedule'''	)


def 		__magic_name__    (	__UpperCAmelCase	)		->					int:

					'''simple docstring'''

					from transformers.testing_utils import pytest_addoption_shared

					pytest_addoption_shared(__UpperCAmelCase	)


def 		__magic_name__    (	__UpperCAmelCase	)		->					Union[str, Any]:

					'''simple docstring'''

					from transformers.testing_utils import pytest_terminal_summary_main

					snake_case_									=				terminalreporter.config.getoption('''--make-reports'''	)
					if make_reports:
										pytest_terminal_summary_main(__UpperCAmelCase,      id=__UpperCAmelCase	)


def 		__magic_name__    (	__UpperCAmelCase,      __UpperCAmelCase	)		->					Optional[int]:

					'''simple docstring'''

					if exitstatus == 5:
										snake_case_									=				0


# Doctest custom flag to ignore output.
a  :				Union[str, Any]									=  doctest.register_optionflag('IGNORE_RESULT')

a  :				Optional[int]									=  doctest.OutputChecker






class 						a				(   _lowerCamelCase     ):


				def   A_ (		self    :					List[Any]       ,				lowercase_    :					int       ,				lowercase_    :					Tuple       ,				lowercase_    :					Optional[int]					):
									if IGNORE_RESULT & optionflags:
														return True
									return OutputChecker.check_output(self       ,				lowercase_       ,				lowercase_       ,				lowercase_					)







a  :				List[Any]									=  CustomOutputChecker
a  :				Optional[int]									=  HfDoctestModule

a  :				Tuple									=  HfDocTestParser

