


import os
import time

import numpy as np
import onnxruntime as ort


__lowerCAmelCase			=							'''1'''
__lowerCAmelCase			=							'''0'''
__lowerCAmelCase			=							'''1'''

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

__lowerCAmelCase			=							1_28
__lowerCAmelCase			=							1
__lowerCAmelCase			=							np.ones((batch, sequence), dtype=np.intaa)
__lowerCAmelCase			=							np.ones((batch, sequence), dtype=np.intaa)
__lowerCAmelCase			=							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...''')
__lowerCAmelCase			=							time.time()
__lowerCAmelCase			=							20_00
__lowerCAmelCase			=							{}
for iter in range(max_iters):
 __lowerCAmelCase			=							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))






from __future__ import annotations




def        snake_case_					(  snake_case      ,							snake_case					)  ->    list[str]:
       if nth_term == "":
              return [""]
       lowercase__:       Tuple        =       int(snake_case					)
       lowercase__:       int        =       int(snake_case					)
       lowercase__:       list[str]        =       []
       for temp in range(int(snake_case					)					):
              series.append(f'1 / {pow(temp + 1      ,							int(snake_case					)					)}' if series else '1'					)
       return series


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 __lowerCAmelCase			=							int(input('''Enter the last number (nth term) of the P-Series'''))
 __lowerCAmelCase			=							int(input('''Enter the power for  P-Series'''))
 print('''Formula of P-Series => 1+1/2^p+1/3^p ..... 1/n^p''')
 print(p_series(nth_term, power))


