ortcy#

ort_get_available_providers#

onnx_extended.ortcy.wrap.ortinf.ort_get_available_providers()#

Returns the list of available providers.

OrtSession#

class onnx_extended.ortcy.wrap.ortinf.OrtSession#

Wrapper around onnxruntime C API based on cython.

Parameters:
  • filename – filename (str) or a bytes for a model serialized in memory

  • graph_optimisation_level – level of graph optimisation, nodes fusion, see onnxruntime Graph Optimizations

  • enable_cuda – use CUDA provider

  • cuda_device_id – CUDA device id

  • set_denormal_as_zero – if a tensor contains too many denormal numbers, the execution is slowing down

  • optimized_file_path – to write the optimized model

  • inter_op_num_threads – number of threads used to parallelize the execution of the graph

  • intra_op_num_threads – number of threads used to parallelize the execution within nodes

get_input_count()#

Returns the number of inputs.

get_output_count()#

Returns the number of outputs.

run()#

Runs the inference. The number of inputs and outputs must not exceed 10.

run_1_1()#

Runs the inference assuming the model has one input and one output.

run_2()#

Runs the inference assuming the model has two inputs.