'''simple docstring'''





from __future__ import annotations

from bisect import bisect_left
from functools import total_ordering
from heapq import merge




@total_ordering
class        __A      ( A_	):



    def __lt__(self    :    Any   ,			__a    :    int ):
         return self[-1] < other[-1]






    def __eq__(self    :    int   ,			__a    :    Optional[Any] ):
         return self[-1] == other[-1]





def 	lowerCAmelCase_				(					snake_case_       : list			)    ->      list:


     '''simple docstring'''




     UpperCAmelCase_           =   []
     # sort into stacks
     for element in collection:
          UpperCAmelCase_           =   Stack([element]			)
          UpperCAmelCase_           =   bisect_left(__lowerCamelCase					,    __lowerCamelCase			)
          if i != len(__lowerCamelCase			):
               stacks[i].append(__lowerCamelCase			)
          else:
               stacks.append(__lowerCamelCase			)

          # use a heap-based merge to merge stack efficiently
     UpperCAmelCase_           =   merge(*(reversed(__lowerCamelCase			) for stack in stacks)			)
     return collection


if __name__ == "__main__":
    SCREAMING_SNAKE_CASE_:     Dict  =input('Enter numbers separated by a comma:\n').strip()
    SCREAMING_SNAKE_CASE_:     List[str]  =[int(item) for item in user_input.split(',')]
    print(patience_sort(unsorted))






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



