CreateOpaqueValue property

Pointer<NativeFunction<OrtStatusPtr Function(Pointer<Char> domain_name, Pointer<Char> type_name, Pointer<Void> data_container, Size data_container_size, Pointer<Pointer<OrtValue>> out)>> CreateOpaqueValue
getter/setter pair

\brief Create an opaque (custom user defined type) ::OrtValue

Constructs an ::OrtValue that contains a value of non-standard type created for experiments or while awaiting standardization. ::OrtValue in this case would contain an internal representation of the Opaque type. Opaque types are distinguished from each other by two strings 1) domain and 2) type name. The combination of the two must be unique, so the type representation is properly identified internally. The combination must be properly registered from within ORT at both compile/run time or by another API.

To construct the ::OrtValue pass domain and type names, also a pointer to a data container the type of which must be known to both ORT and the client program. That data container may or may not match the internal representation of the Opaque type. The sizeof(data_container) is passed for verification purposes.

\paramin domain_name Null terminated string of the domain name \paramin type_name Null terminated string of the type name \paramin data_container User pointer Data to populate ::OrtValue \paramin data_container_size Size in bytes of what data_container points to \paramout out Newly created ::OrtValue. Must be freed with OrtApi::ReleaseValue

\snippet{doc} snippets.dox OrtStatus Return Value

Implementation

external ffi.Pointer<
  ffi.NativeFunction<
    OrtStatusPtr Function(
      ffi.Pointer<ffi.Char> domain_name,
      ffi.Pointer<ffi.Char> type_name,
      ffi.Pointer<ffi.Void> data_container,
      ffi.Size data_container_size,
      ffi.Pointer<ffi.Pointer<OrtValue>> out,
    )
  >
>
CreateOpaqueValue;