

import os
import time

import numpy as np
import onnxruntime as ort


snake_case_        =			'''1'''
snake_case_        =			'''0'''
snake_case_        =			'''1'''

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

snake_case_        =			128
snake_case_        =			1
snake_case_        =			np.ones((batch, sequence), dtype=np.intaa)
snake_case_        =			np.ones((batch, sequence), dtype=np.intaa)
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...''')
snake_case_        =			time.time()
snake_case_        =			2_000
snake_case_        =			{}
for iter in range(max_iters):
       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_000 / max_iters))




from __future__ import annotations

import math

def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   int      ):



     '''simple docstring'''





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

def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   int      ):



     '''simple docstring'''





     lowercase__   :       int				=	str(SCREAMING_SNAKE_CASE_      )
     lowercase__   :       Union[str, Any]				=	[n]
     for i in range(1     ,					len(SCREAMING_SNAKE_CASE_      )      ):
          list_nums.append(int(str_num[i:]      )      )
          list_nums.append(int(str_num[:-i]      )      )
     return list_nums

def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   int      ):



     '''simple docstring'''





     if len(str(SCREAMING_SNAKE_CASE_      )      ) > 3:
          if not is_prime(int(str(SCREAMING_SNAKE_CASE_      )[-3:]      )      ) or not is_prime(int(str(SCREAMING_SNAKE_CASE_      )[:3]      )      ):
               return False
     return True

def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   int = 11      ):



     '''simple docstring'''





     lowercase__   :       list[int]				=	[]
     lowercase__   :       Tuple				=	13
     while len(SCREAMING_SNAKE_CASE_      ) != count:
          if validate(SCREAMING_SNAKE_CASE_      ):
               lowercase__   :       Optional[int]				=	list_truncated_nums(SCREAMING_SNAKE_CASE_      )
               if all(is_prime(SCREAMING_SNAKE_CASE_      ) for i in list_nums      ):
                    list_truncated_primes.append(SCREAMING_SNAKE_CASE_      )
          num += 2
     return list_truncated_primes

def      snake_case__      (   ):



     '''simple docstring'''





     return sum(compute_truncated_primes(11      )      )


if __name__ == "__main__":
       print(F'''{sum(compute_truncated_primes(11)) = }''')

