


import copy

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


SCREAMING_SNAKE_CASE__     					=			logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__     					=			{
    "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 						_UpperCAmelCase      (     lowercase							):
		lowerCamelCase_	:			Any       			=  """dpt"""






		def __init__(						self				:     Any   ,  UpperCAmelCase				:     Dict=7_68   ,  UpperCAmelCase				:     Optional[int]=12   ,  UpperCAmelCase				:     int=12   ,  UpperCAmelCase				:     Union[str, Any]=30_72   ,  UpperCAmelCase				:     str="gelu"   ,  UpperCAmelCase				:     Any=0.0   ,  UpperCAmelCase				:     Tuple=0.0   ,  UpperCAmelCase				:     Union[str, Any]=0.02   ,  UpperCAmelCase				:     Tuple=1E-12   ,  UpperCAmelCase				:     int=3_84   ,  UpperCAmelCase				:     Optional[Any]=16   ,  UpperCAmelCase				:     List[Any]=3   ,  UpperCAmelCase				:     str=False   ,  UpperCAmelCase				:     str=True   ,  UpperCAmelCase				:     Dict=[2, 5, 8, 11]   ,  UpperCAmelCase				:     List[str]="project"   ,  UpperCAmelCase				:     Optional[Any]=[4, 2, 1, 0.5]   ,  UpperCAmelCase				:     List[Any]=[96, 1_92, 3_84, 7_68]   ,  UpperCAmelCase				:     int=2_56   ,  UpperCAmelCase				:     Any=-1   ,  UpperCAmelCase				:     List[Any]=False   ,  UpperCAmelCase				:     str=True   ,  UpperCAmelCase				:     List[str]=0.4   ,  UpperCAmelCase				:     Optional[int]=2_55   ,  UpperCAmelCase				:     Optional[Any]=0.1   ,  UpperCAmelCase				:     Union[str, Any]=[1, 10_24, 24, 24]   ,  UpperCAmelCase				:     List[str]=[0, 1]   ,  UpperCAmelCase				:     str=None   ,  **UpperCAmelCase				:     int   ,  ):
				super().__init__(**UpperCAmelCase)

				SCREAMING_SNAKE_CASE_				:Optional[int]				     =						hidden_size
				SCREAMING_SNAKE_CASE_				:Optional[int]				     =						is_hybrid

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

						SCREAMING_SNAKE_CASE_				:int				     =						backbone_featmap_shape
						SCREAMING_SNAKE_CASE_				:Union[str, Any]				     =						neck_ignore_stages

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

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







		def _snake_case		(						self				:     List[Any]):
				SCREAMING_SNAKE_CASE_				:List[str]				     =						copy.deepcopy(self.__dict__)

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

				SCREAMING_SNAKE_CASE_				:str				     =						self.__class__.model_type
				return output










import qiskit


def     lowercase	(    a     , a ):



		'''simple docstring'''




		SCREAMING_SNAKE_CASE_				:int				     =						qiskit.Aer.get_backend("aer_simulator" )

		# Create a Quantum Circuit acting on the q register
		SCREAMING_SNAKE_CASE_				:Union[str, Any]				     =						qiskit.QuantumCircuit(a     , a )

		# Apply X (NOT) Gate to Qubits 0 & 1
		circuit.x(0 )
		circuit.x(1 )

		# Map the quantum measurement to the classical bits
		circuit.measure([0, 1]     , [0, 1] )

		# Execute the circuit on the qasm simulator
		SCREAMING_SNAKE_CASE_				:Any				     =						qiskit.execute(a     , a     , shots=1000 )

		# Return the histogram data of the results of the experiment.
		return job.result().get_counts(a )


if __name__ == "__main__":
		SCREAMING_SNAKE_CASE__     					=			single_qubit_measure(2, 2)
		print(F'''Total count for various states are: {counts}''')






