






'''simple docstring'''


import os
import time

import numpy as np
import onnxruntime as ort


SCREAMING_SNAKE_CASE_					   =				"1"
SCREAMING_SNAKE_CASE_					   =				"0"
SCREAMING_SNAKE_CASE_					   =				"1"

SCREAMING_SNAKE_CASE_					   =				ort.SessionOptions()
SCREAMING_SNAKE_CASE_					   =				ort.GraphOptimizationLevel.ORT_DISABLE_ALL
print("Create inference session...")
SCREAMING_SNAKE_CASE_					   =				["TensorrtExecutionProvider", "CUDAExecutionProvider"]
SCREAMING_SNAKE_CASE_					   =				ort.InferenceSession("model.onnx", sess_options=sess_opt, providers=execution_provider)
SCREAMING_SNAKE_CASE_					   =				ort.RunOptions()

SCREAMING_SNAKE_CASE_					   =				1_2_8
SCREAMING_SNAKE_CASE_					   =				1
SCREAMING_SNAKE_CASE_					   =				np.ones((batch, sequence), dtype=np.intaa)
SCREAMING_SNAKE_CASE_					   =				np.ones((batch, sequence), dtype=np.intaa)
SCREAMING_SNAKE_CASE_					   =				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...")
SCREAMING_SNAKE_CASE_					   =				time.time()
SCREAMING_SNAKE_CASE_					   =				2_0_0_0
SCREAMING_SNAKE_CASE_					   =				{}
for iter in range(max_iters):
  SCREAMING_SNAKE_CASE_					   =				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) * 1_0_0_0 / max_iters))






import math





def      lowerCamelCase_					(							lowerCamelCase__       ):

				if 1 < number < 4:
								# 2 and 3 are primes
								return True
				elif number < 2 or number % 2 == 0 or number % 3 == 0:
								# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
								return False

				# All primes number are in format of 6k +/- 1
				for i in range(5      ,					int(math.sqrt(lowerCamelCase__       ) + 1       )      ,					6       ):
								if number % i == 0 or number % (i + 2) == 0:
												return False
				return True





def      lowerCamelCase_					(							lowerCamelCase__ = 1_0_0_0_1       ):

				try:
								lowerCamelCase_         =     int(lowerCamelCase__       )
				except (TypeError, ValueError):
								raise TypeError("Parameter nth must be int or castable to int."       ) from None
				if nth <= 0:
								raise ValueError("Parameter nth must be greater than or equal to one."       )
				lowerCamelCase_         =     []
				lowerCamelCase_         =     2
				while len(lowerCamelCase__       ) < nth:
								if is_prime(lowerCamelCase__       ):
												primes.append(lowerCamelCase__       )
												num += 1
								else:
												num += 1
				return primes[len(lowerCamelCase__       ) - 1]


if __name__ == "__main__":
			print(F"""{solution() = }""")


