onnxruntime

package module
v0.0.0-...-13e1700 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

README

go-onnx

Go binding Onnxruntime C++ API

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CudaOptions

type CudaOptions struct {
	DeviceID              int
	CudnnConvAlgoSearch   CudnnConvAlgoSearch
	GPUMemorylimit        int
	ArenaExtendStrategy   bool
	DoCopyInDefaultStream bool
	HasUserComputeStream  bool
}

type CudnnConvAlgoSearch

type CudnnConvAlgoSearch int
const (
	OrtCudnnConvAlgoSearchExhaustive CudnnConvAlgoSearch = iota // expensive exhaustive benchmarking using cudnnFindConvolutionForwardAlgorithmEx
	OrtCudnnConvAlgoSearchHeuristic                             // lightweight heuristic based search using cudnnGetConvolutionForwardAlgorithm_v7
	OrtCudnnConvAlgoSearchDefault                               // default algorithm using CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_PRECOMP_GEMM
)

type ORTEnv

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

func NewORTEnv

func NewORTEnv(loggingLevel ORTLoggingLevel, logEnv string) (ortEnv *ORTEnv)

NewORTEnv Create onnxruntime environment

type ORTLoggingLevel

type ORTLoggingLevel int
const (
	ORT_LOGGING_LEVEL_VERBOSE ORTLoggingLevel = iota // Verbose informational messages (least severe).
	ORT_LOGGING_LEVEL_INFO                           // Informational messages.
	ORT_LOGGING_LEVEL_WARNING                        // Warning messages.
	ORT_LOGGING_LEVEL_ERROR                          // Error messages.
	ORT_LOGGING_LEVEL_FATAL                          // Fatal error messages (most severe).
)

type ORTSession

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

func NewORTSession

func NewORTSession(ortEnv *ORTEnv, modelLocation string, sessionOptions *ORTSessionOptions) (ortSession *ORTSession, err error)

NewORTSession return new onnxruntime session

func (*ORTSession) Predict

func (ortSession *ORTSession) Predict(inputTensorValues []TensorValue) (result []TensorValue, err error)

Predict do prediction from input data

type ORTSessionOptions

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

func NewORTSessionOptions

func NewORTSessionOptions() *ORTSessionOptions

NewORTSessionOptions return empty onnxruntime session options.

func (ORTSessionOptions) AppendExecutionProviderCUDA

func (so ORTSessionOptions) AppendExecutionProviderCUDA(cudaOptions CudaOptions)

AppendExecutionProviderCUDA append cuda device to the session options.

type ORTValues

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

type OnnxTensorElementDataType

type OnnxTensorElementDataType int
const (
	ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED OnnxTensorElementDataType = iota
	ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT
	ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8
	ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8
	ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT16
	ONNX_TENSOR_ELEMENT_DATA_TYPE_INT16
	ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32
	ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64
	ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL
	ONNX_TENSOR_ELEMENT_DATA_TYPE_DOUBLE
	ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT32
	ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64
)

type TensorValue

type TensorValue struct {
	Value interface{}
	Shape []int64
}

Jump to

Keyboard shortcuts

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