
"""simple docstring"""

import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..bit import BitConfig


UpperCamelCase			:       int									=				logging.get_logger(__name__)

UpperCamelCase			:       Any									=				{
    "Intel/dpt-large": "https://huggingface.co/Intel/dpt-large/resolve/main/config.json",
    # See all DPT models at https://huggingface.co/models?filter=dpt
}

class __lowerCAmelCase	(   __SCREAMING_SNAKE_CASE    ):
     lowercase		     =		"dpt"





     def __init__(			self			,  __UpperCAmelCase=768			,  __UpperCAmelCase=12			,  __UpperCAmelCase=12			,  __UpperCAmelCase=3072			,  __UpperCAmelCase="gelu"			,  __UpperCAmelCase=0.0			,  __UpperCAmelCase=0.0			,  __UpperCAmelCase=0.0_2			,  __UpperCAmelCase=1E-12			,  __UpperCAmelCase=384			,  __UpperCAmelCase=16			,  __UpperCAmelCase=3			,  __UpperCAmelCase=False			,  __UpperCAmelCase=True			,  __UpperCAmelCase=[2, 5, 8, 11]			,  __UpperCAmelCase="project"			,  __UpperCAmelCase=[4, 2, 1, 0.5]			,  __UpperCAmelCase=[96, 192, 384, 768]			,  __UpperCAmelCase=256			,  __UpperCAmelCase=-1			,  __UpperCAmelCase=False			,  __UpperCAmelCase=True			,  __UpperCAmelCase=0.4			,  __UpperCAmelCase=255			,  __UpperCAmelCase=0.1			,  __UpperCAmelCase=[1, 1024, 24, 24]			,  __UpperCAmelCase=[0, 1]			,  __UpperCAmelCase=None			,  **__UpperCAmelCase			,  ):

      '''simple docstring'''




      super().__init__(**__UpperCAmelCase   )

      __UpperCamelCase       						= hidden_size
      __UpperCamelCase       						= is_hybrid

      if self.is_hybrid:
       if backbone_config is None:
        logger.info('Initializing the config with a `BiT` backbone.'   )
        __UpperCamelCase       						= {
            'global_padding': 'same',
            'layer_type': 'bottleneck',
            'depths': [3, 4, 9],
            'out_features': ['stage1', 'stage2', 'stage3'],
            'embedding_dynamic_padding': True,
        }
        __UpperCamelCase       						= BitConfig(**__UpperCAmelCase   )
       elif isinstance(__UpperCAmelCase			,  __UpperCAmelCase   ):
        logger.info('Initializing the config with a `BiT` backbone.'   )
        __UpperCamelCase       						= BitConfig(**__UpperCAmelCase   )
       elif isinstance(__UpperCAmelCase			,  __UpperCAmelCase   ):
        __UpperCamelCase       						= backbone_config
       else:
        raise ValueError(
            F'backbone_config must be a dictionary or a `PretrainedConfig`, got {backbone_config.__class__}.'   )

       __UpperCamelCase       						= backbone_featmap_shape
       __UpperCamelCase       						= neck_ignore_stages

       if readout_type != "project":
        raise ValueError('Readout type must be \'project\' when using `DPT-hybrid` mode.'   )
      else:
       __UpperCamelCase       						= None
       __UpperCamelCase       						= None
       __UpperCamelCase       						= []

      __UpperCamelCase       						= num_hidden_layers
      __UpperCamelCase       						= num_attention_heads
      __UpperCamelCase       						= intermediate_size
      __UpperCamelCase       						= hidden_act
      __UpperCamelCase       						= hidden_dropout_prob
      __UpperCamelCase       						= attention_probs_dropout_prob
      __UpperCamelCase       						= initializer_range
      __UpperCamelCase       						= layer_norm_eps
      __UpperCamelCase       						= image_size
      __UpperCamelCase       						= patch_size
      __UpperCamelCase       						= num_channels
      __UpperCamelCase       						= qkv_bias
      __UpperCamelCase       						= backbone_out_indices
      if readout_type not in ["ignore", "add", "project"]:
       raise ValueError('Readout_type must be one of [\'ignore\', \'add\', \'project\']'   )
      __UpperCamelCase       						= readout_type
      __UpperCamelCase       						= reassemble_factors
      __UpperCamelCase       						= neck_hidden_sizes
      __UpperCamelCase       						= fusion_hidden_size
      __UpperCamelCase       						= head_in_index
      __UpperCamelCase       						= use_batch_norm_in_fusion_residual
      # auxiliary head attributes (semantic segmentation)
      __UpperCamelCase       						= use_auxiliary_head
      __UpperCamelCase       						= auxiliary_loss_weight
      __UpperCamelCase       						= semantic_loss_ignore_index
      __UpperCamelCase       						= semantic_classifier_dropout







     def 		UpperCAmelCase      (			self   ):

      '''simple docstring'''




      __UpperCamelCase       						= copy.deepcopy(self.__dict__   )

      if output["backbone_config"] is not None:
       __UpperCamelCase       						= self.backbone_config.to_dict()

      __UpperCamelCase       						= self.__class__.model_type
      return output





"""simple docstring"""

def 							A		(       snake_case   :int       ,      snake_case   :int	)   ->			int:
 return int(input_a == input_a == 0	)






def 							A		(       )   ->			None:
 print('Truth Table of NOR Gate:'	)
 print('|   Input 1   |  Input 2  | Output |'	)
 print(f'|      0      |    0      |  {nor_gate(0       ,      0	)}     |'	)
 print(f'|      0      |    1      |  {nor_gate(0       ,      1	)}     |'	)
 print(f'|      1      |    0      |  {nor_gate(1       ,      0	)}     |'	)
 print(f'|      1      |    1      |  {nor_gate(1       ,      1	)}     |'	)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      main()



