"""simple docstring"""






import os



def   a_						(					):
				UpperCAmelCase__             =							os.path.dirname(os.path.realpath(lowerCamelCase       )       )
				UpperCAmelCase__             =							os.path.join(lowerCamelCase					,			'triangle.txt'       )

				with open(lowerCamelCase       ) as f:
								UpperCAmelCase__             =							f.readlines()

				UpperCAmelCase__             =							[]
				for line in triangle:
								UpperCAmelCase__             =							[]
								for number in line.strip().split(' '       ):
												numbers_from_line.append(int(lowerCamelCase       )       )
								a.append(lowerCamelCase       )

				for i in range(1					,			len(lowerCamelCase       )       ):
								for j in range(len(a[i]       )       ):
												UpperCAmelCase__             =							a[i - 1][j] if j != len(a[i - 1]       ) else 0
												UpperCAmelCase__             =							a[i - 1][j - 1] if j > 0 else 0
												a[i][j] += max(lowerCamelCase					,			lowerCamelCase       )
				return max(a[-1]       )


if __name__ == "__main__":
						print(solution())





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



