onnxruntime API reference
66 public APIs from onnxruntime (microsoft/onnxruntime) — 36 classes, 10 functions, 20 methods. Signatures extracted by static analysis of the actual source.
Repository: microsoft/onnxruntime
| Kind | Count |
|---|---|
| Classes | 36 |
| Functions | 10 |
| Methods | 20 |
API list
func
onnxruntime.print_debug_info()Print information to help debugging.
class
onnxruntime.python.onnxruntime_inference_collection.InferenceSessionThis is the main class used to run a model.
class
onnxruntime.python.onnxruntime_inference_collection.ModelCompilerThis class is used to compile an ONNX model.
method
onnxruntime.python.onnxruntime_inference_collection.ModelCompiler.compile_to_file(output_model_path:str | None=None)Compiles to an output file.
class
onnxruntime.python.onnxruntime_inference_collection.SessionThis is the main class used to run a model.
method
onnxruntime.python.onnxruntime_inference_collection.Session.disable_fallback() -> NoneDisable session.run() fallback mechanism.
method
onnxruntime.python.onnxruntime_inference_collection.Session.enable_fallback() -> NoneEnable session.Run() fallback mechanism.
method
onnxruntime.python.onnxruntime_inference_collection.Session.get_modelmeta() -> C.ModelMetadataReturn the metadata.
method
onnxruntime.python.onnxruntime_inference_collection.Session.get_session_options() -> C.SessionOptionsReturn the session options.
method
onnxruntime.python.onnxruntime_inference_collection.Session.io_binding() -> IOBindingReturn an onnxruntime.IOBinding object`.
method
onnxruntime.python.onnxruntime_inference_collection.Session.run(output_names, input_feed, run_options=None) -> Sequence[np.ndarray | SparseTensor | list | dict]Compute the predictions.
method
onnxruntime.python.onnxruntime_inference_collection.Session.run_with_ort_values(output_names, input_dict_ort_values, run_options=None) -> Sequence[OrtValue]Compute the predictions.
method
orttraining.orttraining.python.training.api.checkpoint_state.Parameter.data() -> np.ndarrayThe data of the parameter
method
orttraining.orttraining.python.training.api.checkpoint_state.Parameter.grad() -> np.ndarrayThe gradient of the parameter
method
orttraining.orttraining.python.training.api.checkpoint_state.Parameter.name() -> strThe name of the parameter
method
orttraining.orttraining.python.training.api.module.Module.eval() -> ModuleSets the Module in evaluation mode.
method
orttraining.orttraining.python.training.api.module.Module.export_model_for_inferencing(inference_model_uri:str | os.PathLike, graph_output_names:list[str]) -> NoneExports the model for inferencing.
method
orttraining.orttraining.python.training.api.module.Module.get_parameters_size(trainable_only:bool=True) -> intReturns the size of the parameters.
method
orttraining.orttraining.python.training.api.module.Module.train(mode:bool=True) -> ModuleSets the Module in training mode.
method
orttraining.orttraining.python.training.api.optimizer.Optimizer.set_learning_rate(learning_rate:float) -> NoneSets the learning rate for the optimizer.
class
orttraining.orttraining.python.training.artifacts.LossTypeLoss type to be added to the training model.
class
orttraining.orttraining.python.training.onnxblock.blocks.AbsAdds Abs node to the onnx model.
class
orttraining.orttraining.python.training.onnxblock.blocks.AddAdds Add node to an onnx model.
class
orttraining.orttraining.python.training.onnxblock.blocks.ClipAdds Clip node to the onnx model.
class
orttraining.orttraining.python.training.onnxblock.blocks.DivAdds Div node to an onnx model.
class
orttraining.orttraining.python.training.onnxblock.blocks.LogAdds Log node to the onnx model.
class
orttraining.orttraining.python.training.onnxblock.blocks.MulAdds Mul node to an onnx model.
class
orttraining.orttraining.python.training.onnxblock.blocks.NegAdds Neg node to the onnx model.
class
orttraining.orttraining.python.training.onnxblock.blocks.PowAdds Pow node to the onnx model.
class
orttraining.orttraining.python.training.onnxblock.blocks.ReduceAllL2Adds ReduceAllL2 node to the onnx model.
class
orttraining.orttraining.python.training.onnxblock.blocks.ReduceMeanAdds ReduceMean node to the onnx model.
class
orttraining.orttraining.python.training.onnxblock.blocks.ReduceSumAdds ReduceSum node to the onnx model.
class
orttraining.orttraining.python.training.onnxblock.blocks.SigmoidAdds Sigmoid node to the onnx model.
class
orttraining.orttraining.python.training.onnxblock.blocks.SubAdds Sub node to an onnx model.
class
orttraining.orttraining.python.training.optim.fused_adam.FusedAdamImplements Adam algorithm.
class
orttraining.orttraining.python.training.ort_triton._codegen.TritonCodegenSpecialized codegen for Triton backend.
class
orttraining.orttraining.python.training.ort_triton._common.CodegenContextrecord variable name mapping in term of IRnodes.
class
orttraining.orttraining.python.training.ort_triton._common.TensorInfoRepresent a input/output tensor of a node.
class
orttraining.orttraining.python.training.ort_triton._ir.ComputeNodeEach operator is represented as a ComputeNode.
class
orttraining.orttraining.python.training.ort_triton._ir.IRNodeThe base class for all IR nodes.
class
orttraining.orttraining.python.training.ort_triton._ir.ReduceForLoopEndshared-memory reduction
class
orttraining.orttraining.python.training.ort_triton._sorted_graph.SortedGraphThis class is used to 1.
func
orttraining.orttraining.python.training.ort_triton._utils.next_power_of_2(n:int) -> intReturn the smallest power of 2 greater than or equal to n
class
orttraining.orttraining.python.training.ortmodule._execution_agent.ExecutionAgentOutputWraps an OrtValue and adds an ID.
class
orttraining.orttraining.python.training.ortmodule._graph_transition_manager.GraphTransitionManagerManage the graph transition from 1).
func
orttraining.orttraining.python.training.ortmodule._io.calculate_total_parameter_size_in_bytes(module:torch.nn.Module) -> intCalculate the total parameter size in bytes
class
orttraining.orttraining.python.training.ortmodule._onnx_models.ONNXModelsEncapsulates all ORTModule onnx models.
method
orttraining.orttraining.python.training.ortmodule._runtime_inspector.MemoryObserver.is_enabled() -> boolCheck if memory inspector is enabled.
class
orttraining.orttraining.python.training.ortmodule._runtime_inspector.RuntimeInspectorRuntime inspector for ORTModule.
func
orttraining.orttraining.python.training.ortmodule._utils.get_rank() -> intReturns the rank of the current process.
func
orttraining.orttraining.python.training.ortmodule._utils.get_world_size() -> intReturns the world size of the current process.
class
orttraining.orttraining.python.training.ortmodule.experimental.pipe._ort_pipeline_module.ORTPipelineModuleORTPipelineModule pipeline module.
class
orttraining.orttraining.python.training.ortmodule.graph_optimizers.utils.GraphMatcherSub-graph matcher with given pattern.
class
orttraining.orttraining.python.training.ortmodule.options.DebugOptionsConfigurable debugging options for ORTModule.
class
orttraining.orttraining.python.training.utils.ptable.PTableA table that can be printed to the console.
method
orttraining.orttraining.python.training.utils.ptable.PTable.add_row(columns:list[str]) -> RowAdd a row to the table.
method
orttraining.orttraining.python.training.utils.ptable.PTable.get_string(first_column_width=None, second_column_width=None) -> strSerialize the table to a string.
class
orttraining.orttraining.python.training.utils.ptable.RowA row in a PTable
class
orttraining.orttraining.python.training.utils.torch_io_helper.PrimitiveTypeHelper class for Python primitive types.
method
orttraining.orttraining.python.training.utils.torch_io_helper.PrimitiveType.get_tensor(value, device) -> torch.TensorConvert `value` to a torch.Tensor.
class
plugin-ep-cuda.csharp.pack_nuget.PackErrorRaised for any user-actionable failure during packaging.
func
plugin-ep-cuda.csharp.pack_nuget.stage_sources(staging_dir:Path) -> NoneCopy project sources into staging, excluding bin/obj.
func
plugin-ep-cuda.python.onnxruntime_ep_cuda.get_ep_name() -> strReturn the CUDA plugin Execution Provider name.
func
plugin-ep-webgpu.csharp.pack_nuget.stage_sources(staging_dir:Path) -> NoneCopy project sources into staging, excluding bin/obj.
func
plugin-ep-webgpu.python.build_wheel.build_wheel(source_dir:Path, wheel_dir:Path)Build the wheel using pip.
func
plugin-ep-webgpu.python.onnxruntime_ep_webgpu.get_ep_name() -> strReturn the WebGPU Execution Provider name.
About this data
These signatures were extracted from the public source of microsoft/onnxruntime
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.