



'''simple docstring'''





import os
import time

import numpy as np
import onnxruntime as ort


_UpperCamelCase											=		'1'
_UpperCamelCase											=		'0'
_UpperCamelCase											=		'1'

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

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





# Algorithm for the pigeonhole sorting



def 			a_	(				_lowerCAmelCase			) -> List[str]:
  __lowerCamelCase			:			int       			=					min(_lowerCAmelCase			)  # min() finds the minimum value
  __lowerCamelCase			:			List[Any]       			=					max(_lowerCAmelCase			)  # max() finds the maximum value

  __lowerCamelCase			:			List[Any]       			=					max_val - min_val + 1  # size is difference of max and min values plus one

  # list of pigeonholes of size equal to the variable size
  __lowerCamelCase			:			List[Any]       			=					[0] * size

  # Populate the pigeonholes.
  for x in a:
    assert isinstance(_lowerCAmelCase			,_lowerCAmelCase			), "integers only please"
    holes[x - min_val] += 1

  # Putting the elements back into the array in an order.
  __lowerCamelCase			:			Tuple       			=					0
  for count in range(_lowerCAmelCase			):
    while holes[count] > 0:
      holes[count] -= 1
      __lowerCamelCase			:			List[Any]       			=					count + min_val
      i += 1

def 			a_	(				) -> str:
  __lowerCamelCase			:			Optional[Any]       			=					[8, 3, 2, 7, 4, 6, 8]
  pigeonhole_sort(_lowerCAmelCase			)
  print('Sorted order is:'			,' '.join(_lowerCAmelCase			)			)


if __name__ == "__main__":
   main()






