The runtime's process-wide state, which every session runs in.
Moduleonnxruntime-0.1.0.0GHC2024
OnnxRuntime
ONNX Runtime from Haskell: an environment, sessions on models with their options, and runs on named tensors, each resource held by a bracket. Failures are thrown as OrtError.
- 15 types
- 1 class
- 24 values
- Packageonnxruntime-0.1.0.0
- Exports40
- LanguageGHC2024
- LicenceMIT
- SourceOnnxRuntime.hs
Environment
4 declarationsHow much the runtime logs to stderr.
Instances5Bounded, Enum, Eq, Ord, Show
Bounded LoggingLevelDefined in onnxruntime-0.1.0.0 · OnnxRuntime.SessionEnum LoggingLevelDefined in onnxruntime-0.1.0.0 · OnnxRuntime.SessionEq LoggingLevelDefined in onnxruntime-0.1.0.0 · OnnxRuntime.SessionOrd LoggingLevelDefined in onnxruntime-0.1.0.0 · OnnxRuntime.SessionShow LoggingLevelDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Session
An environment for the length of an action, logging at this level under this identifier.
The version of the runtime library loaded.
Sessions
11 declarationsConstructors
MkSessionOptionsintraOpThreads :: Intthreads within one node; 0 lets the runtime choose
interOpThreads :: Intthreads across nodes; 0 lets the runtime choose
graphOptimisation :: GraphOptimisationexecutionProviders :: [ExecutionProvider]tried in order before the CPU
Instances2Eq, Show
Eq SessionOptionsDefined in onnxruntime-0.1.0.0 · OnnxRuntime.SessionShow SessionOptionsDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Session
The runtime's own thread counts, every optimisation, the CPU alone.
How far the runtime rewrites a graph before running it.
Instances5Bounded, Enum, Eq, Ord, Show
Bounded GraphOptimisationDefined in onnxruntime-0.1.0.0 · OnnxRuntime.SessionEnum GraphOptimisationDefined in onnxruntime-0.1.0.0 · OnnxRuntime.SessionEq GraphOptimisationDefined in onnxruntime-0.1.0.0 · OnnxRuntime.SessionOrd GraphOptimisationDefined in onnxruntime-0.1.0.0 · OnnxRuntime.SessionShow GraphOptimisationDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Session
Where a session runs its nodes. The CPU always runs whatever the others leave; CUDA and ROCm take a device number, and a runtime built without them refuses the session with a RuntimeError.
Instances2Eq, Show
Eq ExecutionProviderDefined in onnxruntime-0.1.0.0 · OnnxRuntime.SessionShow ExecutionProviderDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Session
An open model with what it declares. It is valid only inside the action it was opened for.
An input or output a model declares.
Constructors
MkTensorInfotensorName :: TexttensorElementType :: Maybe ElementTypeNothing when it is not a tensor of a supported element type
tensorDims :: [Dim]
Instances2Eq, Show
Eq TensorInfoDefined in onnxruntime-0.1.0.0 · OnnxRuntime.SessionShow TensorInfoDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Session
A session on a model file for the length of an action.
A session on a model held in memory for the length of an action.
Run a session on named inputs for the named outputs, in that order. Each input is checked against what the model declares first.
Tensors
12 declarationsElements in row-major order with the shape they fill exactly.
A tensor when the shape holds exactly the elements given and no dimension is negative.
A tensor of any element type, as a run takes and gives them.
Constructors
SomeTensor :: Element a => Tensor a -> SomeTensor
Instances2Eq, Show
Eq SomeTensorDefined in onnxruntime-0.1.0.0 · OnnxRuntime.TensorShow SomeTensorDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Tensor
The tensor, when it holds elements of this type.
Instances5Bounded, Enum, Eq, Ord, Show
Bounded ElementTypeDefined in onnxruntime-0.1.0.0 · OnnxRuntime.ElementEnum ElementTypeDefined in onnxruntime-0.1.0.0 · OnnxRuntime.ElementEq ElementTypeDefined in onnxruntime-0.1.0.0 · OnnxRuntime.ElementOrd ElementTypeDefined in onnxruntime-0.1.0.0 · OnnxRuntime.ElementShow ElementTypeDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Element
A Haskell type the runtime stores with the same layout.
Methods
Instances10Element, …
Element Int16Defined in onnxruntime-0.1.0.0 · OnnxRuntime.ElementElement Int32Defined in onnxruntime-0.1.0.0 · OnnxRuntime.ElementElement Int64Defined in onnxruntime-0.1.0.0 · OnnxRuntime.ElementElement Int8Defined in onnxruntime-0.1.0.0 · OnnxRuntime.ElementElement DoubleDefined in onnxruntime-0.1.0.0 · OnnxRuntime.ElementElement FloatDefined in onnxruntime-0.1.0.0 · OnnxRuntime.ElementElement Word16Defined in onnxruntime-0.1.0.0 · OnnxRuntime.ElementElement Word32Defined in onnxruntime-0.1.0.0 · OnnxRuntime.ElementElement Word64Defined in onnxruntime-0.1.0.0 · OnnxRuntime.ElementElement Word8Defined in onnxruntime-0.1.0.0 · OnnxRuntime.Element
The runtime's number for an element type (ONNXTensorElementDataType).
Shapes
7 declarationsA tensor's dimensions, outermost first; the empty shape is a scalar.
Row-major strides: how far apart neighbours along each dimension lie.
The flat offset of a multi-index, when it lies inside the shape.
The multi-index of a flat offset, when it lies inside the shape.
A dimension a model declares: a fixed size, or one left free under a symbolic name (empty when unnamed).
Whether declared dimensions take a shape: the same rank, and every fixed dimension equal.
Errors
4 declarationsConstructors
RuntimeError ErrorCode TextThe runtime refused a call, with its code and message.
ShapeMismatch Shape IntA shape and the number of elements it was given.
NoSuchInput TextA name the session has no input of.
NoSuchOutput TextA name the session has no output of.
InputType Text ElementType ElementTypeAn input, the element type the model takes there, and the one given.
InputShape Text [Dim] ShapeAn input, the dimensions the model takes there, and the shape given.
Unsupported TextAn input or output that is not a tensor of a supported element type.
The runtime's status codes (OrtErrorCode).
The code for the runtime's number.
The error as onnxruntime: message.
Leaks
2 declarationsHow many of each handle are open in the process: a program whose brackets have all ended holds none.
Constructors
Instances2Eq, Show
Eq LiveHandlesDefined in onnxruntime-0.1.0.0 · OnnxRuntime.SessionShow LiveHandlesDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Session