



'''simple docstring'''


import os
import time

import numpy as np
import onnxruntime as ort


lowercase							       =			'''1'''
lowercase							       =			'''0'''
lowercase							       =			'''1'''

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

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







'''simple docstring'''


from __future__ import annotations






def  UpperCAmelCase_       (		lowercase__       ):


     '''simple docstring'''







     a_       		=str(lowercase__       )
     return len(lowercase__       ) == 9 and set(lowercase__       ) == set("123456789"       )






def  UpperCAmelCase_       (		):


     '''simple docstring'''







     for base_num in range(9_9_9_9       ,	4_9_9_9       ,	-1       ):
          a_       		=1_0_0_0_0_2 * base_num
          if is_9_pandigital(lowercase__       ):
               return candidate

     for base_num in range(3_3_3       ,	9_9       ,	-1       ):
          a_       		=1_0_0_2_0_0_3 * base_num
          if is_9_pandigital(lowercase__       ):
               return candidate

     return None


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


