





'''simple docstring'''




import os
import time

import numpy as np
import onnxruntime as ort


lowercase__   :				Tuple      =   '''1'''
lowercase__   :				Any      =   '''0'''
lowercase__   :				Any      =   '''1'''

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

lowercase__   :				Any      =   1_28
lowercase__   :				Tuple      =   1
lowercase__   :				Tuple      =   np.ones((batch, sequence), dtype=np.intaa)
lowercase__   :				Any      =   np.ones((batch, sequence), dtype=np.intaa)
lowercase__   :				Optional[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...''')
lowercase__   :				Any      =   time.time()
lowercase__   :				List[Any]      =   20_00
lowercase__   :				int      =   {}
for iter in range(max_iters):
  lowercase__   :				Tuple      =   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 math






def 	_lowerCAmelCase      (  __snake_case  :			int      )					->					bool:

     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(__snake_case      ) + 1      )			,							6      ):
          if number % i == 0 or number % (i + 2) == 0:
               return False
     return True






def 	_lowerCAmelCase      (  __snake_case  :			float = 0.1      )					->					int:
     __A						:			Dict								=	3
     __A						:			int								=	3

     while primes / (2 * j - 1) >= ratio:
          for i in range(j * j + j + 1			,							(j + 2) * (j + 2)			,							j + 1      ):
               primes += is_prime(__snake_case      )
          j += 2
     return j


if __name__ == "__main__":
  import doctest

  doctest.testmod()