



'''simple docstring'''




import os
import time

import numpy as np
import onnxruntime as ort


UpperCamelCase__ :			Union[str, Any]												=				'''1'''
UpperCamelCase__ :			Tuple												=				'''0'''
UpperCamelCase__ :			Optional[int]												=				'''1'''

UpperCamelCase__ :			List[Any]												=				ort.SessionOptions()
UpperCamelCase__ :			List[str]												=				ort.GraphOptimizationLevel.ORT_DISABLE_ALL
print('''Create inference session...''')
UpperCamelCase__ :			List[Any]												=				['''TensorrtExecutionProvider''', '''CUDAExecutionProvider''']
UpperCamelCase__ :			List[Any]												=				ort.InferenceSession('''model.onnx''', sess_options=sess_opt, providers=execution_provider)
UpperCamelCase__ :			Tuple												=				ort.RunOptions()

UpperCamelCase__ :			Union[str, Any]												=				1_28
UpperCamelCase__ :			Any												=				1
UpperCamelCase__ :			Any												=				np.ones((batch, sequence), dtype=np.intaa)
UpperCamelCase__ :			Optional[Any]												=				np.ones((batch, sequence), dtype=np.intaa)
UpperCamelCase__ :			Union[str, Any]												=				np.ones((batch, sequence), dtype=np.intaa)

print('''Warm up phase...''')
sess.run(
    None,
    {
        sess.get_inputs()[0].name: input_ids,
        sess.get_inputs()[1].name: attention_mask,
        sess.get_inputs()[2].name: token_type_ids,
    },
    run_options=run_opt,
)

print('''Start inference...''')
UpperCamelCase__ :			Tuple												=				time.time()
UpperCamelCase__ :			Any												=				20_00
UpperCamelCase__ :			Union[str, Any]												=				{}
for iter in range(max_iters):
						UpperCamelCase__ :			List[Any]												=				sess.run(
						    None,
						    {
						        sess.get_inputs()[0].name: input_ids,
						        sess.get_inputs()[1].name: attention_mask,
						        sess.get_inputs()[2].name: token_type_ids,
						    },
						    run_options=run_opt,
						)
print('''Average Inference Time = {:.3f} ms'''.format((time.time() - start_time) * 10_00 / max_iters))




'''simple docstring'''




import qiskit


def        lowerCAmelCase_     (			_lowerCamelCase:     int = 2      ):
		__SCREAMING_SNAKE_CASE :	Dict					 =	qubits

		# Using Aer's simulator
		__SCREAMING_SNAKE_CASE :	Optional[Any]					 =	qiskit.Aer.get_backend("""aer_simulator"""      )

		# Creating a Quantum Circuit acting on the q register
		__SCREAMING_SNAKE_CASE :	str					 =	qiskit.QuantumCircuit(_lowerCamelCase ,   _lowerCamelCase      )

		# Adding a H gate on qubit 0 (now q0 in superposition)
		circuit.h(0      )

		for i in range(1 ,   _lowerCamelCase      ):
				# Adding CX (CNOT) gate
				circuit.cx(i - 1 ,   _lowerCamelCase      )

		# Mapping the quantum measurement to the classical bits
		circuit.measure(list(range(_lowerCamelCase      )      ) ,   list(range(_lowerCamelCase      )      )      )

		# Now measuring any one qubit would affect other qubits to collapse
		# their super position and have same state as the measured one.

		# Executing the circuit on the simulator
		__SCREAMING_SNAKE_CASE :	str					 =	qiskit.execute(_lowerCamelCase ,   _lowerCamelCase ,   shots=10_00      )

		return job.result().get_counts(_lowerCamelCase      )


if __name__ == "__main__":
						print(f"Total count for various states are: {quantum_entanglement(3)}")