Module: OnnxRuntime::FFI

Extended by:
FFI::Library
Defined in:
lib/onnxruntime/ffi.rb

Defined Under Namespace

Classes: Api, ApiBase, Libc

Constant Summary collapse

ORT_API_VERSION =
16
TensorElementDataType =

enums

enum(:undefined, :float, :uint8, :int8, :uint16, :int16, :int32, :int64, :string, :bool, :float16, :double, :uint32, :uint64, :complex64, :complex128, :bfloat16)
OnnxType =
enum(:unknown, :tensor, :sequence, :map, :opaque, :sparsetensor, :optional)

Class Method Summary collapse

Class Method Details

.apiObject



249
250
251
252
253
254
255
# File 'lib/onnxruntime/ffi.rb', line 249

def self.api
  @api ||= begin
    api = self.OrtGetApiBase[:GetApi].call(ORT_API_VERSION)
    api = Api.by_ref.from_native(api, nil) if RUBY_PLATFORM == "java"
    api
  end
end