






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
from ..auto import CONFIG_MAPPING


lowerCamelCase : str						   =       logging.get_logger(__name__)

lowerCamelCase : List[Any]						   =       {
    '''microsoft/table-transformer-detection''': (
        '''https://huggingface.co/microsoft/table-transformer-detection/resolve/main/config.json'''
    ),
}

class 		lowerCAmelCase     ( __a			):

					'''simple docstring'''

					_A						:			Optional[Any]									=      '''table-transformer'''
					_A						:			Optional[Any]									=      ['''past_key_values''']
					_A						:			Union[str, Any]									=      {
					    '''hidden_size''': '''d_model''',
					    '''num_attention_heads''': '''encoder_attention_heads''',
					}



					def __init__(  self				:	Any		,     __a				:	Optional[Any]=True		,     __a				:	Any=None		,     __a				:	Tuple=3		,     __a				:	Dict=100		,     __a				:	str=6		,     __a				:	List[str]=2048		,     __a				:	Optional[int]=8		,     __a				:	Union[str, Any]=6		,     __a				:	str=2048		,     __a				:	Dict=8		,     __a				:	Dict=0.0		,     __a				:	Dict=0.0		,     __a				:	str=True		,     __a				:	Dict="relu"		,     __a				:	int=256		,     __a				:	Any=0.1		,     __a				:	List[str]=0.0		,     __a				:	Union[str, Any]=0.0		,     __a				:	Optional[Any]=0.02		,     __a				:	Tuple=1.0		,     __a				:	Union[str, Any]=False		,     __a				:	Union[str, Any]="sine"		,     __a				:	Any="resnet50"		,     __a				:	Optional[Any]=True		,     __a				:	List[Any]=False		,     __a				:	Any=1		,     __a				:	Optional[Any]=5		,     __a				:	Any=2		,     __a				:	Optional[Any]=1		,     __a				:	Union[str, Any]=1		,     __a				:	Dict=5		,     __a				:	List[Any]=2		,     __a				:	Dict=0.1		,     **__a				:	Optional[int]		,     )			->  Any:


												"""simple docstring"""

												if backbone_config is not None and use_timm_backbone:
																			raise ValueError("""You can't specify both `backbone_config` and `use_timm_backbone`."""							)

												if not use_timm_backbone:
																			if backbone_config is None:
																										logger.info("""`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone."""							)
																										__lowercase      :							int				=     CONFIG_MAPPING["""resnet"""](out_features=["""stage4"""]							)
																			elif isinstance(__a		,     __a							):
																										__lowercase      :							Dict				=     backbone_config.get("""model_type"""							)
																										__lowercase      :							List[Any]				=     CONFIG_MAPPING[backbone_model_type]
																										__lowercase      :							Tuple				=     config_class.from_dict(__a							)
																			# set timm attributes to None
																			__lowercase			,			__lowercase			,			__lowercase      :							Optional[Any]				=     None, None, None

												__lowercase      :							Optional[int]				=     use_timm_backbone
												__lowercase      :							str				=     backbone_config
												__lowercase      :							Optional[Any]				=     num_channels
												__lowercase      :							Dict				=     num_queries
												__lowercase      :							Tuple				=     d_model
												__lowercase      :							Dict				=     encoder_ffn_dim
												__lowercase      :							Dict				=     encoder_layers
												__lowercase      :							Optional[int]				=     encoder_attention_heads
												__lowercase      :							Optional[Any]				=     decoder_ffn_dim
												__lowercase      :							List[str]				=     decoder_layers
												__lowercase      :							Optional[Any]				=     decoder_attention_heads
												__lowercase      :							List[Any]				=     dropout
												__lowercase      :							str				=     attention_dropout
												__lowercase      :							Any				=     activation_dropout
												__lowercase      :							List[Any]				=     activation_function
												__lowercase      :							int				=     init_std
												__lowercase      :							Union[str, Any]				=     init_xavier_std
												__lowercase      :							int				=     encoder_layerdrop
												__lowercase      :							List[Any]				=     decoder_layerdrop
												__lowercase      :							Any				=     encoder_layers
												__lowercase      :							List[Any]				=     auxiliary_loss
												__lowercase      :							Tuple				=     position_embedding_type
												__lowercase      :							Any				=     backbone
												__lowercase      :							Union[str, Any]				=     use_pretrained_backbone
												__lowercase      :							Optional[int]				=     dilation
												# Hungarian matcher
												__lowercase      :							Dict				=     class_cost
												__lowercase      :							Optional[Any]				=     bbox_cost
												__lowercase      :							Union[str, Any]				=     giou_cost
												# Loss coefficients
												__lowercase      :							Any				=     mask_loss_coefficient
												__lowercase      :							int				=     dice_loss_coefficient
												__lowercase      :							Any				=     bbox_loss_coefficient
												__lowercase      :							int				=     giou_loss_coefficient
												__lowercase      :							List[Any]				=     eos_coefficient
												super().__init__(is_encoder_decoder=__a		,     **__a							)



					@property
					def       lowerCAmelCase				(  self				:	Any							)			->  int:


												"""simple docstring"""

												return self.encoder_attention_heads



					@property
					def       lowerCAmelCase				(  self				:	Optional[Any]							)			->  int:


												"""simple docstring"""

												return self.d_model







class 		lowerCAmelCase     ( __a			):

					'''simple docstring'''

					_A						:			Union[str, Any]									=      version.parse('''1.11'''			)



					@property
					def       lowerCAmelCase				(  self				:	int							)			->  Mapping[str, Mapping[int, str]]:


												"""simple docstring"""

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



					@property
					def       lowerCAmelCase				(  self				:	int							)			->  float:


												"""simple docstring"""

												return 1E-5



					@property
					def       lowerCAmelCase				(  self				:	Tuple							)			->  int:


												"""simple docstring"""

												return 12







def       snake_case_		(     lowerCAmelCase_       :						int       ,       lowerCAmelCase_       :						int      ):
							return int((input_a, input_a).count(1      ) != 0      )
def       snake_case_		(     ):
							assert or_gate(0       ,       0      ) == 0
							assert or_gate(0       ,       1      ) == 1
							assert or_gate(1       ,       0      ) == 1
							assert or_gate(1       ,       1      ) == 1


if __name__ == "__main__":
	print(or_gate(0, 1))
	print(or_gate(1, 0))
	print(or_gate(0, 0))
	print(or_gate(1, 1))