






"""simple docstring"""







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))








"""simple docstring"""







def      UpperCamelCase       ( _A )     ->       int:
				lowercase    :      Dict       = 0
				while num > 0:
								digit_sum += num % 10
								num //= 10
				return digit_sum


def      UpperCamelCase       ( _A = 100 )     ->       int:
				lowercase    :      Union[str, Any]       = 1
				lowercase    :      Tuple       = 2

				for i in range(2  ,				max_n + 1 ):
								lowercase    :      Any       = pre_numerator
								lowercase    :      Dict       = 2 * i // 3 if i % 3 == 0 else 1
								lowercase    :      Optional[Any]       = cur_numerator
								lowercase    :      str       = e_cont * pre_numerator + temp

				return sum_digits(_A )


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