HORIZON HASKELLDocslts/ghc-10.0.x8c2f8e82026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19

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

Environment

4 declarations
newtypenewtype Environment
#

The runtime's process-wide state, which every session runs in.

Sessions

11 declarations
datadata GraphOptimisation
#

How far the runtime rewrites a graph before running it.

Instances5Bounded, Enum, Eq, Ord, Show
datadata Session
#

An open model with what it declares. It is valid only inside the action it was opened for.

valuerun :: Session -> [(Text, SomeTensor)] -> [Text] -> IO [SomeTensor]
#

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 declarations
datadata Tensor a
#

Elements in row-major order with the shape they fill exactly.

Instances2Eq, Show
classclass (Storable a, Typeable a, Eq a, Show a) => Element a where
#

A Haskell type the runtime stores with the same layout.

Instances10Element, …
  • Element Int16Defined in onnxruntime-0.1.0.0 · OnnxRuntime.Element
  • Element Int32Defined in onnxruntime-0.1.0.0 · OnnxRuntime.Element
  • Element Int64Defined in onnxruntime-0.1.0.0 · OnnxRuntime.Element
  • Element Int8Defined in onnxruntime-0.1.0.0 · OnnxRuntime.Element
  • Element DoubleDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Element
  • Element FloatDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Element
  • Element Word16Defined in onnxruntime-0.1.0.0 · OnnxRuntime.Element
  • Element Word32Defined in onnxruntime-0.1.0.0 · OnnxRuntime.Element
  • Element Word64Defined in onnxruntime-0.1.0.0 · OnnxRuntime.Element
  • Element Word8Defined in onnxruntime-0.1.0.0 · OnnxRuntime.Element

Shapes

7 declarations
newtypenewtype Shape
#

A tensor's dimensions, outermost first; the empty shape is a scalar.

Constructors

Instances3Eq, Ord, Show
  • Eq ShapeDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Shape
  • Ord ShapeDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Shape
  • Show ShapeDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Shape
valuestrides :: Shape -> [Int]
#

Row-major strides: how far apart neighbours along each dimension lie.

datadata Dim
#

A dimension a model declares: a fixed size, or one left free under a symbolic name (empty when unnamed).

Constructors

Instances2Eq, Show
  • Eq DimDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Shape
  • Show DimDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Shape
valueaccepts :: [Dim] -> Shape -> Bool
#

Whether declared dimensions take a shape: the same rank, and every fixed dimension equal.

Errors

4 declarations
datadata OrtError
#

Constructors

Instances3Eq, Show, Exception
  • Eq OrtErrorDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Error
  • Show OrtErrorDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Error
  • Exception OrtErrorDefined in onnxruntime-0.1.0.0 · OnnxRuntime.Error

Leaks

2 declarations