onnx

package
v0.0.0-...-7e7f144 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Runtime)

Option is a functional option for configuring Runtime

func WithCachePath

func WithCachePath(path string) Option

WithCachePath sets the cache directory

func WithGPU

func WithGPU(enabled bool) Option

WithGPU enables GPU support

func WithLibraryPath

func WithLibraryPath(path string) Option

WithLibraryPath sets a direct path to the ONNX Runtime library

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

Runtime manages ONNX Runtime initialization and configuration

func New

func New(ctx context.Context, opts ...Option) (*Runtime, error)

New creates a new ONNX Runtime manager

func (*Runtime) Close

func (r *Runtime) Close() error

Close cleans up ONNX Runtime resources

func (*Runtime) EnsureRuntime

func (r *Runtime) EnsureRuntime(ctx context.Context) (string, error)

EnsureRuntime downloads and extracts the ONNX Runtime library

func (*Runtime) RuntimeInfo

func (r *Runtime) RuntimeInfo() *RuntimeInfo

GetRuntimeInfo returns information about the current runtime

func (*Runtime) RuntimeURL

func (r *Runtime) RuntimeURL(info *RuntimeInfo) string

RuntimeURL returns the download URL for a specific runtime

func (*Runtime) Version

func (r *Runtime) Version() string

Version returns the current ONNX Runtime version

type RuntimeInfo

type RuntimeInfo struct {
	Version     string
	OS          string
	Arch        string
	GPU         bool
	LibraryName string
}

RuntimeInfo contains ONNX Runtime specific information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL