'''simple docstring'''


import os
import time

import numpy as np
import onnxruntime as ort


snake_case__					:      Optional[int]					      =  '''1'''
snake_case__					:      str					      =  '''0'''
snake_case__					:      List[str]					      =  '''1'''

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

snake_case__					:      List[Any]					      =  128
snake_case__					:      Union[str, Any]					      =  1
snake_case__					:      Tuple					      =  np.ones((batch, sequence), dtype=np.intaa)
snake_case__					:      Tuple					      =  np.ones((batch, sequence), dtype=np.intaa)
snake_case__					:      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...''')
snake_case__					:      Union[str, Any]					      =  time.time()
snake_case__					:      str					      =  2000
snake_case__					:      Tuple					      =  {}
for iter in range(max_iters):
 snake_case__					:      str					      =  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) * 1000 / max_iters))







'''simple docstring'''


def  _lowerCamelCase   (				lowerCamelCase_ :							int     ,					lowerCamelCase_ :							int       ):



     """simple docstring"""





     return int(input_a == input_a == 0       )


def  _lowerCamelCase   (				):



     """simple docstring"""





     print('Truth Table of NOR Gate:'       )
     print('|   Input 1   |  Input 2  | Output |'       )
     print(F'''|      0      |    0      |  {nor_gate(0     ,					0       )}     |'''       )
     print(F'''|      0      |    1      |  {nor_gate(0     ,					1       )}     |'''       )
     print(F'''|      1      |    0      |  {nor_gate(1     ,					0       )}     |'''       )
     print(F'''|      1      |    1      |  {nor_gate(1     ,					1       )}     |'''       )


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 main()






