33 #include <unordered_map>
35 #include <type_traits>
37 #ifdef ORT_NO_EXCEPTIONS
54 const char*
what()
const noexcept
override {
return message_.c_str(); }
61 #ifdef ORT_NO_EXCEPTIONS
64 #ifndef ORT_CXX_API_THROW
65 #define ORT_CXX_API_THROW(string, code) \
67 std::cerr << Ort::Exception(string, code) \
74 #define ORT_CXX_API_THROW(string, code) \
75 throw Ort::Exception(string, code)
88 #ifdef ORT_API_MANUAL_INIT
106 inline void InitApi(
const OrtApi* api) { Global<void>::api_ = api; }
108 #if defined(_MSC_VER) && !defined(__clang__)
109 #pragma warning(push)
112 #pragma warning(disable : 26426)
115 #if defined(_MSC_VER) && !defined(__clang__)
173 constexpr
operator uint16_t()
const noexcept {
return value; }
178 static_assert(
sizeof(Float16_t) ==
sizeof(uint16_t),
"Sizes must match");
192 constexpr
operator uint16_t()
const noexcept {
return value; }
197 static_assert(
sizeof(BFloat16_t) ==
sizeof(uint16_t),
"Sizes must match");
202 #define ORT_DEFINE_RELEASE(NAME) \
203 inline void OrtRelease(Ort##NAME* ptr) { GetApi().Release##NAME(ptr); }
226 #undef ORT_DEFINE_RELEASE
231 template <
typename T>
255 template <
typename T>
259 constexpr
Base() =
default;
288 template <
typename T>
298 template <
typename T>
302 constexpr
Base() =
default;
335 struct AllocatorWithDefaultOptions;
339 struct ModelMetadata;
353 explicit Status(OrtStatus* status);
355 explicit Status(
const std::exception&);
396 explicit Env(std::nullptr_t) {}
414 Env& EnableTelemetryEvents();
512 std::unordered_map<std::string, std::string> flat_configs_;
525 template <
typename T>
537 template <
typename T>
584 const std::unordered_map<std::string, std::string>& provider_options = {});
608 explicit SessionOptions(OrtSessionOptions* p) : SessionOptionsImpl<OrtSessionOptions>{p} {}
688 template <
typename T>
732 template <
typename T>
754 std::vector<Value>
Run(
const RunOptions& run_options,
const char*
const* input_names,
const Value* input_values,
size_t input_count,
755 const char*
const* output_names,
size_t output_count);
760 void Run(
const RunOptions& run_options,
const char*
const* input_names,
const Value* input_values,
size_t input_count,
761 const char*
const* output_names,
Value* output_values,
size_t output_count);
786 OrtPrepackedWeightsContainer* prepacked_weights_container);
789 OrtPrepackedWeightsContainer* prepacked_weights_container);
796 template <
typename T>
807 template <
typename U>
827 template <
typename T>
841 [[deprecated(
"use GetShape()")]]
void GetDimensions(int64_t*
values,
size_t values_count)
const;
845 std::vector<int64_t>
GetShape()
const;
862 template <
typename T>
878 explicit SequenceTypeInfo(OrtSequenceTypeInfo* p) : SequenceTypeInfoImpl<OrtSequenceTypeInfo>{p} {}
883 template <
typename T>
900 explicit MapTypeInfo(OrtMapTypeInfo* p) : MapTypeInfoImpl<OrtMapTypeInfo>{p} {}
905 template <
typename T>
930 explicit TypeInfo(OrtTypeInfo* p) : TypeInfoImpl<OrtTypeInfo>{p} {}
960 template <
typename T>
968 template <
typename R>
1007 template <
typename R>
1056 #if !defined(DISABLE_SPARSE_TENSORS)
1090 template <
typename R>
1107 template <
typename R>
1113 template <
typename T>
1123 template <
typename R>
1139 template <
typename R>
1156 #if !defined(DISABLE_SPARSE_TENSORS)
1165 void UseCooIndices(int64_t* indices_data,
size_t indices_num);
1177 void UseCsrIndices(int64_t* inner_data,
size_t inner_num, int64_t* outer_data,
size_t outer_num);
1199 const int64_t* indices_data,
size_t indices_num);
1214 const int64_t* inner_indices_data,
size_t inner_indices_num,
1215 const int64_t* outer_indices_data,
size_t outer_indices_num);
1228 const Shape& indices_shape,
1229 const int32_t* indices_data);
1263 template <
typename T>
1283 template <
typename T>
1297 template <
typename T>
1300 #if !defined(DISABLE_SPARSE_TENSORS)
1311 template <
typename T>
1313 const Shape& values_shape);
1343 template <
typename T>
1359 #endif // !defined(DISABLE_SPARSE_TENSORS)
1376 void*
get() {
return p_; }
1377 size_t size()
const {
return size_; }
1386 template <
typename T>
1418 namespace binding_utils {
1424 template <
typename T>
1435 template <
typename T>
1478 ArenaCfg(
size_t max_mem,
int arena_extend_strategy,
int initial_chunk_size_bytes,
int max_dead_bytes_per_chunk);
1514 namespace attr_utils {
1522 template <
typename T>
1529 template <
typename R>
1536 template <
typename R>
1575 explicit Op(std::nullptr_t) {}
1577 explicit Op(OrtOp*);
1580 int version,
const char** type_constraint_names,
1582 size_t type_constraint_count,
1583 const OpAttr* attr_values,
1585 size_t input_count,
size_t output_count);
1588 const Value* input_values,
1590 Value* output_values,
1591 size_t output_count);
1595 const OrtValue*
const* input_values,
1598 size_t output_count);
1618 [[deprecated(
"use Ort::TensorTypeAndShapeInfo::GetElementCount()")]]
size_t GetTensorShapeElementCount(
_In_ const OrtTensorTypeAndShapeInfo* info);
1630 [[deprecated(
"use Ort::TensorTypeAndShapeInfo::GetDimensionsCount()")]]
size_t GetDimensionsCount(
_In_ const OrtTensorTypeAndShapeInfo* info);
1636 [[deprecated(
"use Ort::TensorTypeAndShapeInfo::GetShape()")]]
void GetDimensions(
_In_ const OrtTensorTypeAndShapeInfo* info,
_Out_ int64_t* dim_values,
size_t dim_values_length);
1642 [[deprecated(
"Do not use")]]
void SetDimensions(OrtTensorTypeAndShapeInfo* info,
_In_ const int64_t* dim_values,
size_t dim_count);
1648 template <
typename T>
1655 template <
typename T>
1668 [[deprecated(
"use Ort::TensorTypeAndShapeInfo::GetShape()")]] std::vector<int64_t>
GetTensorShape(
const OrtTensorTypeAndShapeInfo* info);
1732 _In_ const char* op_name,
1733 _In_ const char* domain,
1735 _In_opt_ const char** type_constraint_names,
1737 _In_opt_ int type_constraint_count,
1738 _In_opt_ const OrtOpAttr*
const* attr_values,
1740 _In_ int input_count,
1741 _In_ int output_count);
1748 _In_ const OrtOp* ort_op,
1750 _In_ int input_count,
1752 _In_ int output_count);
1765 template <
typename T>
1786 template <
typename TOp,
typename TKernel>
1795 OrtCustomOp::GetInputTypeCount = [](
const OrtCustomOp* this_) {
return static_cast<const TOp*
>(this_)->GetInputTypeCount(); };
1796 OrtCustomOp::GetInputType = [](
const OrtCustomOp* this_,
size_t index) {
return static_cast<const TOp*
>(this_)->GetInputType(
index); };
1799 OrtCustomOp::GetOutputTypeCount = [](
const OrtCustomOp* this_) {
return static_cast<const TOp*
>(this_)->GetOutputTypeCount(); };
1800 OrtCustomOp::GetOutputType = [](
const OrtCustomOp* this_,
size_t index) {
return static_cast<const TOp*
>(this_)->GetOutputType(
index); };
1803 #if defined(_MSC_VER) && !defined(__clang__)
1804 #pragma warning(push)
1805 #pragma warning(disable : 26409)
1807 OrtCustomOp::KernelDestroy = [](
void* op_kernel) {
delete static_cast<TKernel*
>(op_kernel); };
1808 #if defined(_MSC_VER) && !defined(__clang__)
1809 #pragma warning(pop)
1866 return std::vector<std::string>{};
OrtMemType GetMemoryType() const
const char * GetExecutionProviderType() const
OrtMemoryInfoDeviceType GetDeviceType() const
ONNXTensorElementDataType GetTensorElementType(const OrtTensorTypeAndShapeInfo *info)
UnownedSession GetUnowned() const
void * KernelContext_GetGPUComputeStream(const OrtKernelContext *context)
void Invoke(const OrtKernelContext *context, const Value *input_values, size_t input_count, Value *output_values, size_t output_count)
SessionOptionsImpl & SetCustomJoinThreadFn(OrtCustomJoinThreadFn ort_custom_join_thread_fn)
Wraps OrtApi::SessionOptionsSetCustomJoinThreadFn.
size_t GetElementCount() const
Wraps OrtApi::GetTensorShapeElementCount.
OrtCustomOpInputOutputCharacteristic GetInputCharacteristic(size_t) const
ONNXType GetONNXType() const
static Value CreateOpaque(const char *domain, const char *type_name, const T &)
Wraps OrtApi::CreateOpaqueValue.
MemoryAllocation & operator=(const MemoryAllocation &)=delete
AllocatorWithDefaultOptions(std::nullptr_t)
Convenience to create a class member and then replace with an instance.
Env & DisableTelemetryEvents()
Wraps OrtApi::EnableTelemetryEvents.
AllocatedStringPtr GetOverridableInitializerNameAllocated(size_t index, OrtAllocator *allocator) const
Returns a copy of the overridable initializer name at then specified index.
This is a tagging template type. Use it with Base<T> to indicate that the C++ interface object has no...
ThreadingOptions & SetGlobalSpinControl(int allow_spinning)
Wraps OrtApi::SetGlobalSpinControl.
SequenceTypeInfo(OrtSequenceTypeInfo *p)
TypeInfo(std::nullptr_t)
Create an empty TypeInfo object, must be assigned a valid one to be used.
constexpr Base(contained_type *p) noexcept
OrtCustomThreadHandle(* OrtCustomCreateThreadFn)(void *ort_custom_thread_creation_options, OrtThreadWorkerFn ort_thread_worker_fn, void *ort_worker_fn_param)
Ort custom thread creation function.
void *ORT_API_CALL * CreateKernel(_In_ const struct OrtCustomOp *op, _In_ const OrtApi *api, _In_ const OrtKernelInfo *info)
std::string GetErrorMessage() const
size_t GetInputCount() const
Returns the number of model inputs.
SessionOptionsImpl & DisablePerSessionThreads()
Wraps OrtApi::DisablePerSessionThreads.
Env & UpdateEnvWithCustomLogLevel(OrtLoggingLevel log_severity_level)
Wraps OrtApi::UpdateEnvWithCustomLogLevel.
void InvokeOp(_In_ const OrtKernelContext *context, _In_ const OrtOp *ort_op, _In_ const OrtValue *const *input_values, _In_ int input_count, _Inout_ OrtValue *const *output_values, _In_ int output_count)
void UseBlockSparseIndices(const Shape &indices_shape, int32_t *indices_data)
Supplies BlockSparse format specific indices and marks the contained sparse tensor as being a BlockSp...
RunOptions & AddConfigEntry(const char *config_key, const char *config_value)
Wraps OrtApi::AddRunConfigEntry.
ConstMapTypeInfo GetMapTypeInfo() const
Wraps OrtApi::CastTypeInfoToMapTypeInfo.
void FillSparseTensorCsr(const OrtMemoryInfo *data_mem_info, const OrtSparseValuesParam &values, const int64_t *inner_indices_data, size_t inner_indices_num, const int64_t *outer_indices_data, size_t outer_indices_num)
The API will allocate memory using the allocator instance supplied to the CreateSparseTensor() API an...
TypeInfo GetInputTypeInfo(size_t index) const
Wraps OrtApi::SessionGetInputTypeInfo.
size_t GetOutputCount() const
void GetSymbolicDimensions(const char **values, size_t values_count) const
Wraps OrtApi::GetSymbolicDimensions.
Type information that may contain either TensorTypeAndShapeInfo or the information about contained se...
SessionOptionsImpl & EnableMemPattern()
Wraps OrtApi::EnableMemPattern.
TensorTypeAndShapeInfo(std::nullptr_t)
Create an empty TensorTypeAndShapeInfo object, must be assigned a valid one to be used...
SessionOptionsImpl & EnableCpuMemArena()
Wraps OrtApi::EnableCpuMemArena.
static MemoryInfo CreateCpu(OrtAllocatorType type, OrtMemType mem_type1)
Value(OrtValue *p)
Used for interop with the C API.
Env(OrtEnv *p)
C Interop Helper.
bool IsTensor() const
Returns true if Value is a tensor, false for other types like map/sequence/etc.
AllocatedStringPtr GetOutputNameAllocated(size_t index, OrtAllocator *allocator) const
Returns a copy of output name at then specified index.
void GetOpaqueData(const char *domain, const char *type_name, R &) const
Obtains a pointer to a user defined data for experimental purposes
const void * GetTensorRawData() const
Returns a non-typed pointer to a tensor contained data.
ConstMemoryInfo GetInfo() const
T * GetTensorMutableData(_Inout_ OrtValue *value)
void GetStringTensorElement(size_t buffer_length, size_t element_index, void *buffer) const
The API copies UTF-8 encoded bytes for the requested string element contained within a tensor or a sp...
Value(std::nullptr_t)
Create an empty Value object, must be assigned a valid one to be used.
SessionOptionsImpl & SetLogId(const char *logid)
Wraps OrtApi::SetSessionLogId.
void swap(UT::ArraySet< Key, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual > &a, UT::ArraySet< Key, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual > &b)
CustomOpConfigs()=default
Value GetValue(int index, OrtAllocator *allocator) const
Base & operator=(Base &&v) noexcept
uint64_t GetProfilingStartTimeNs() const
Wraps OrtApi::SessionGetProfilingStartTimeNs.
Status(std::nullptr_t)
Create an empty object, must be assigned a valid one to be used.
SessionOptionsImpl & AppendExecutionProvider_MIGraphX(const OrtMIGraphXProviderOptions &provider_options)
Wraps OrtApi::SessionOptionsAppendExecutionProvider_CANN.
UnownedValue GetOutput(size_t index, const int64_t *dim_values, size_t dim_count) const
GLsizei const GLchar *const * string
void BindInput(const char *name, const Value &)
ONNXTensorElementDataType GetMapKeyType() const
Wraps OrtApi::GetMapKeyType.
OrtMemoryInfoDeviceType
This mimics OrtDevice type constants so they can be returned in the API.
ConstValue GetInput(size_t index) const
SessionOptionsImpl & AppendExecutionProvider_CANN(const OrtCANNProviderOptions &provider_options)
MemoryAllocation GetAllocation(size_t size)
std::unique_ptr< char, detail::AllocatedFree > AllocatedStringPtr
unique_ptr typedef used to own strings allocated by OrtAllocators and release them at the end of the ...
SessionOptionsImpl & DisableCpuMemArena()
Wraps OrtApi::DisableCpuMemArena.
bool HasConfigEntry(const char *config_key) const
Wraps OrtApi::HasSessionConfigEntry.
void UseCsrIndices(int64_t *inner_data, size_t inner_num, int64_t *outer_data, size_t outer_num)
Supplies CSR format specific indices and marks the contained sparse tensor as being a CSR format tens...
ONNXTensorElementDataType GetElementType() const
Wraps OrtApi::GetTensorElementType.
Used internally by the C++ API. C++ wrapper types inherit from this. This is a zero cost abstraction ...
ConstMemoryInfo GetConst() const
Take ownership of a pointer created by C Api.
Env & CreateAndRegisterAllocator(const OrtMemoryInfo *mem_info, const OrtArenaCfg *arena_cfg)
Wraps OrtApi::CreateAndRegisterAllocator.
void FillStringTensorElement(const char *s, size_t index)
Set a single string in a string tensor
void ReleaseOp(_Frees_ptr_opt_ OrtOp *ort_op)
std::vector< Value > Run(const RunOptions &run_options, const char *const *input_names, const Value *input_values, size_t input_count, const char *const *output_names, size_t output_count)
Run the model returning results in an Ort allocated vector.
void GetDimensions(_In_ const OrtTensorTypeAndShapeInfo *info, _Out_ int64_t *dim_values, size_t dim_values_length)
SessionOptionsImpl & AddInitializer(const char *name, const OrtValue *ort_val)
Wraps OrtApi::AddInitializer.
TensorTypeAndShapeInfo(OrtTensorTypeAndShapeInfo *p)
Used for interop with the C API.
const R * GetSparseTensorIndicesData(OrtSparseIndicesFormat indices_format, size_t &num_indices) const
The API retrieves a pointer to the internal indices buffer. The API merely performs a convenience dat...
Wrapper around ::OrtMapTypeInfo.
void SynchronizeOutputs()
std::string GetConfigEntryOrDefault(const char *config_key, const std::string &def)
OpAttr(const char *name, const void *data, int len, OrtOpAttrType type)
SessionOptionsImpl & AppendExecutionProvider_TensorRT(const OrtTensorRTProviderOptions &provider_options)
Wraps OrtApi::SessionOptionsAppendExecutionProvider_TensorRT.
SessionOptionsImpl & EnableOrtCustomOps()
Wraps OrtApi::EnableOrtCustomOps.
size_t GetDimensionsCount() const
Wraps OrtApi::GetDimensionsCount.
This struct provides life time management for custom op attribute
R & At(const std::vector< int64_t > &location)
std::string GetAllocatorName() const
detail::SequenceTypeInfoImpl< detail::Unowned< const OrtSequenceTypeInfo >> ConstSequenceTypeInfo
SessionOptionsImpl & AppendExecutionProvider_CUDA(const OrtCUDAProviderOptions &provider_options)
Wraps OrtApi::SessionOptionsAppendExecutionProvider_CUDA.
const int64_t * values_shape
MapTypeInfo(OrtMapTypeInfo *p)
std::vector< R > GetAttributes(const char *name) const
SessionOptionsImpl & SetIntraOpNumThreads(int intra_op_num_threads)
Wraps OrtApi::SetIntraOpNumThreads.
static Value CreateSequence(std::vector< Value > &values)
Wraps OrtApi::CreateValue.
**But if you need a result
it is a structure that represents the configuration of an arena based allocator
SessionOptionsImpl & RegisterCustomOpsUsingFunction(const char *function_name)
Wraps OrtApi::RegisterCustomOpsUsingFunction.
IoBinding(std::nullptr_t)
Create an empty object for convenience. Sometimes, we want to initialize members later.
static const OrtApi * api_
SessionOptionsImpl & SetOptimizedModelFilePath(const ORTCHAR_T *optimized_model_file)
Wraps OrtApi::SetOptimizedModelFilePath.
Env(std::nullptr_t)
Create an empty Env object, must be assigned a valid one to be used.
ThreadingOptions & SetGlobalCustomJoinThreadFn(OrtCustomJoinThreadFn ort_custom_join_thread_fn)
Wraps OrtApi::SetGlobalCustomJoinThreadFn.
const R * GetSparseTensorValues() const
The API returns a pointer to an internal buffer of the sparse tensor containing non-zero values...
constexpr bool operator==(const Float16_t &rhs) const noexcept
void * Alloc(size_t size)
TensorTypeAndShapeInfo GetSparseTensorIndicesTypeShapeInfo(OrtSparseIndicesFormat format) const
The API returns type and shape information for the specified indices. Each supported indices have the...
SessionOptionsImpl & SetGraphOptimizationLevel(GraphOptimizationLevel graph_optimization_level)
Wraps OrtApi::SetSessionGraphOptimizationLevel.
const R * GetTensorData() const
Returns a const typed pointer to the tensor contained data. No type checking is performed, the caller must ensure the type matches the tensor type.
SessionOptionsImpl & SetCustomThreadCreationOptions(void *ort_custom_thread_creation_options)
Wraps OrtApi::SessionOptionsSetCustomThreadCreationOptions.
void * GetTensorMutableRawData()
Returns a non-typed non-const pointer to a tensor contained data.
union Ort::detail::OrtSparseValuesParam::@93 data
static Op Create(const OrtKernelInfo *info, const char *op_name, const char *domain, int version, const char **type_constraint_names, const ONNXTensorElementDataType *type_constraint_values, size_t type_constraint_count, const OpAttr *attr_values, size_t attr_count, size_t input_count, size_t output_count)
ConstSession GetConst() const
std::string GetConfigEntry(const char *config_key) const
Wraps OrtApi::GetSessionConfigEntry.
std::vector< std::string > GetOutputNames() const
void(ORT_API_CALL * OrtLoggingFunction)(void *param, OrtLoggingLevel severity, const char *category, const char *logid, const char *code_location, const char *message)
SessionOptionsImpl & AppendExecutionProvider_TensorRT_V2(const OrtTensorRTProviderOptionsV2 &provider_options)
Wraps OrtApi::SessionOptionsAppendExecutionProvider_TensorRT.
constexpr bool operator!=(const BFloat16_t &rhs) const noexcept
GLuint GLsizei const GLuint const GLintptr * offsets
bool IsSparseTensor() const
Returns true if the OrtValue contains a sparse tensor
std::vector< Value > GetOutputValuesHelper(const OrtIoBinding *binding, OrtAllocator *)
constexpr BFloat16_t() noexcept
void ReleaseKernelInfo(_Frees_ptr_opt_ OrtKernelInfo *info_copy)
int GetVariadicInputMinArity() const
ModelMetadata GetModelMetadata() const
Wraps OrtApi::SessionGetModelMetadata.
size_t GetDimensionsCount(_In_ const OrtTensorTypeAndShapeInfo *info)
OrtCustomOpInputOutputCharacteristic
Wrapper around OrtAllocator.
ThreadingOptions & SetGlobalInterOpNumThreads(int inter_op_num_threads)
Wraps OrtApi::SetGlobalInterOpNumThreads.
void FillSparseTensorBlockSparse(const OrtMemoryInfo *data_mem_info, const OrtSparseValuesParam &values, const Shape &indices_shape, const int32_t *indices_data)
The API will allocate memory using the allocator instance supplied to the CreateSparseTensor() API an...
TypeInfo GetOutputTypeInfo(size_t index) const
std::vector< int64_t > GetShape() const
Uses GetDimensionsCount & GetDimensions to return a std::vector of the shape.
const T * GetTensorData(_Inout_ const OrtValue *value)
const OrtValue * KernelContext_GetInput(const OrtKernelContext *context, _In_ size_t index)
std::vector< int64_t > GetTensorShape(const OrtTensorTypeAndShapeInfo *info)
Wrapper around OrtMemoryInfo.
const OrtMemoryInfo * GetTensorMemoryInfo(_In_ const OrtValue *value)
std::vector< std::string > GetAvailableProviders()
This is a C++ wrapper for OrtApi::GetAvailableProviders() and returns a vector of strings representin...
Op(std::nullptr_t)
Create an empty Operator object, must be assigned a valid one to be used.
size_t GetTensorShapeElementCount(_In_ const OrtTensorTypeAndShapeInfo *info)
SessionOptions Clone() const
Creates and returns a copy of this SessionOptions object. Wraps OrtApi::CloneSessionOptions.
detail::MapTypeInfoImpl< detail::Unowned< const OrtMapTypeInfo >> ConstMapTypeInfo
Wrapper around ::OrtIoBinding.
void GetAttrs(const OrtKernelInfo *p, const char *name, std::vector< float > &)
constexpr BFloat16_t(uint16_t v) noexcept
CustomOpApi(const OrtApi &api)
#define ORT_API_VERSION
The API version defined in this header.
SessionOptionsImpl & SetCustomCreateThreadFn(OrtCustomCreateThreadFn ort_custom_create_thread_fn)
Wraps OrtApi::SessionOptionsSetCustomCreateThreadFn.
OrtKernelInfo * CopyKernelInfo(_In_ const OrtKernelInfo *info)
The Status that holds ownership of OrtStatus received from C API Use it to safely destroy OrtStatus* ...
OrtOpAttr * CreateOpAttr(_In_ const char *name, _In_ const void *data, _In_ int len, _In_ OrtOpAttrType type)
void GetStringTensorContent(void *buffer, size_t buffer_length, size_t *offsets, size_t offsets_count) const
The API copies all of the UTF-8 encoded string data contained within a tensor or a sparse tensor into...
void GetDimensions(int64_t *values, size_t values_count) const
Wraps OrtApi::GetDimensions.
The default allocator for execution provider.
detail::SessionOptionsImpl< detail::Unowned< OrtSessionOptions >> UnownedSessionOptions
All C++ methods that can fail will throw an exception of this type.
const char * what() const noexceptoverride
OrtMemType GetInputMemoryType(size_t) const
A generic, discriminated value, whose type may be queried dynamically.
void ReleaseTensorTypeAndShapeInfo(OrtTensorTypeAndShapeInfo *input)
void GetAttr(const OrtKernelInfo *p, const char *name, float &)
typename Unowned< T >::Type contained_type
CustomOpDomain(std::nullptr_t)
Create an empty CustomOpDomain object, must be assigned a valid one to be used.
SessionOptionsImpl & AppendExecutionProvider_OpenVINO(const OrtOpenVINOProviderOptions &provider_options)
Wraps OrtApi::SessionOptionsAppendExecutionProvider_OpenVINO.
Wrapper around ::OrtSequenceTypeInfo.
const std::unordered_map< std::string, std::string > & GetFlattenedConfigs() const
Returns a flattened map of custom operator configuration entries and their values.
This class wraps a raw pointer OrtKernelContext* that is being passed to the custom kernel Compute() ...
SessionOptionsImpl & AppendExecutionProvider_CUDA_V2(const OrtCUDAProviderOptionsV2 &provider_options)
Wraps OrtApi::SessionOptionsAppendExecutionProvider_CUDA_V2.
CustomOpConfigs & operator=(const CustomOpConfigs &)=default
constexpr std::enable_if< I< type_count_base< T >::value, int >::type tuple_type_size(){return subtype_count< typename std::tuple_element< I, T >::type >::value+tuple_type_size< T, I+1 >);}template< typename T > struct type_count< T, typename std::enable_if< is_tuple_like< T >::value >::type >{static constexpr int value{tuple_type_size< T, 0 >)};};template< typename T > struct subtype_count{static constexpr int value{is_mutable_container< T >::value?expected_max_vector_size:type_count< T >::value};};template< typename T, typename Enable=void > struct type_count_min{static const int value{0};};template< typename T >struct type_count_min< T, typename std::enable_if<!is_mutable_container< T >::value &&!is_tuple_like< T >::value &&!is_wrapper< T >::value &&!is_complex< T >::value &&!std::is_void< T >::value >::type >{static constexpr int value{type_count< T >::value};};template< typename T > struct type_count_min< T, typename std::enable_if< is_complex< T >::value >::type >{static constexpr int value{1};};template< typename T >struct type_count_min< T, typename std::enable_if< is_wrapper< T >::value &&!is_complex< T >::value &&!is_tuple_like< T >::value >::type >{static constexpr int value{subtype_count_min< typename T::value_type >::value};};template< typename T, std::size_t I >constexpr typename std::enable_if< I==type_count_base< T >::value, int >::type tuple_type_size_min(){return 0;}template< typename T, std::size_t I > constexpr typename std::enable_if< I< type_count_base< T >::value, int >::type tuple_type_size_min(){return subtype_count_min< typename std::tuple_element< I, T >::type >::value+tuple_type_size_min< T, I+1 >);}template< typename T > struct type_count_min< T, typename std::enable_if< is_tuple_like< T >::value >::type >{static constexpr int value{tuple_type_size_min< T, 0 >)};};template< typename T > struct subtype_count_min{static constexpr int value{is_mutable_container< T >::value?((type_count< T >::value< expected_max_vector_size)?type_count< T >::value:0):type_count_min< T >::value};};template< typename T, typename Enable=void > struct expected_count{static const int value{0};};template< typename T >struct expected_count< T, typename std::enable_if<!is_mutable_container< T >::value &&!is_wrapper< T >::value &&!std::is_void< T >::value >::type >{static constexpr int value{1};};template< typename T > struct expected_count< T, typename std::enable_if< is_mutable_container< T >::value >::type >{static constexpr int value{expected_max_vector_size};};template< typename T >struct expected_count< T, typename std::enable_if<!is_mutable_container< T >::value &&is_wrapper< T >::value >::type >{static constexpr int value{expected_count< typename T::value_type >::value};};enum class object_category:int{char_value=1, integral_value=2, unsigned_integral=4, enumeration=6, boolean_value=8, floating_point=10, number_constructible=12, double_constructible=14, integer_constructible=16, string_assignable=23, string_constructible=24, other=45, wrapper_value=50, complex_number=60, tuple_value=70, container_value=80,};template< typename T, typename Enable=void > struct classify_object{static constexpr object_category value{object_category::other};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_integral< T >::value &&!std::is_same< T, char >::value &&std::is_signed< T >::value &&!is_bool< T >::value &&!std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::integral_value};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_integral< T >::value &&std::is_unsigned< T >::value &&!std::is_same< T, char >::value &&!is_bool< T >::value >::type >{static constexpr object_category value{object_category::unsigned_integral};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_same< T, char >::value &&!std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::char_value};};template< typename T > struct classify_object< T, typename std::enable_if< is_bool< T >::value >::type >{static constexpr object_category value{object_category::boolean_value};};template< typename T > struct classify_object< T, typename std::enable_if< std::is_floating_point< T >::value >::type >{static constexpr object_category value{object_category::floating_point};};template< typename T >struct classify_object< T, typename std::enable_if<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&std::is_assignable< T &, std::string >::value >::type >{static constexpr object_category value{object_category::string_assignable};};template< typename T >struct classify_object< T, typename std::enable_if<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&!std::is_assignable< T &, std::string >::value &&(type_count< T >::value==1)&&std::is_constructible< T, std::string >::value >::type >{static constexpr object_category value{object_category::string_constructible};};template< typename T > struct classify_object< T, typename std::enable_if< std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::enumeration};};template< typename T > struct classify_object< T, typename std::enable_if< is_complex< T >::value >::type >{static constexpr object_category value{object_category::complex_number};};template< typename T > struct uncommon_type{using type=typename std::conditional<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&!std::is_assignable< T &, std::string >::value &&!std::is_constructible< T, std::string >::value &&!is_complex< T >::value &&!is_mutable_container< T >::value &&!std::is_enum< T >::value, std::true_type, std::false_type >::type;static constexpr bool value=type::value;};template< typename T >struct classify_object< T, typename std::enable_if<(!is_mutable_container< T >::value &&is_wrapper< T >::value &&!is_tuple_like< T >::value &&uncommon_type< T >::value)>::type >{static constexpr object_category value{object_category::wrapper_value};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&is_direct_constructible< T, double >::value &&is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::number_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&!is_direct_constructible< T, double >::value &&is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::integer_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&is_direct_constructible< T, double >::value &&!is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::double_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< is_tuple_like< T >::value &&((type_count< T >::value >=2 &&!is_wrapper< T >::value)||(uncommon_type< T >::value &&!is_direct_constructible< T, double >::value &&!is_direct_constructible< T, int >::value)||(uncommon_type< T >::value &&type_count< T >::value >=2))>::type >{static constexpr object_category value{object_category::tuple_value};};template< typename T > struct classify_object< T, typename std::enable_if< is_mutable_container< T >::value >::type >{static constexpr object_category value{object_category::container_value};};template< typename T, enable_if_t< classify_object< T >::value==object_category::char_value, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"CHAR";}template< typename T, enable_if_t< classify_object< T >::value==object_category::integral_value||classify_object< T >::value==object_category::integer_constructible, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"INT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::unsigned_integral, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"UINT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::floating_point||classify_object< T >::value==object_category::number_constructible||classify_object< T >::value==object_category::double_constructible, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"FLOAT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::enumeration, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"ENUM";}template< typename T, enable_if_t< classify_object< T >::value==object_category::boolean_value, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"BOOLEAN";}template< typename T, enable_if_t< classify_object< T >::value==object_category::complex_number, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"COMPLEX";}template< typename T, enable_if_t< classify_object< T >::value >=object_category::string_assignable &&classify_object< T >::value<=object_category::other, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"TEXT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value >=2, detail::enabler >=detail::dummy >std::string type_name();template< typename T, enable_if_t< classify_object< T >::value==object_category::container_value||classify_object< T >::value==object_category::wrapper_value, detail::enabler >=detail::dummy >std::string type_name();template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value==1, detail::enabler >=detail::dummy >inline std::string type_name(){return type_name< typename std::decay< typename std::tuple_element< 0, T >::type >::type >);}template< typename T, std::size_t I >inline typename std::enable_if< I==type_count_base< T >::value, std::string >::type tuple_name(){return std::string{};}template< typename T, std::size_t I >inline typename std::enable_if<(I< type_count_base< T >::value), std::string >::type tuple_name(){auto str=std::string{type_name< typename std::decay< typename std::tuple_element< I, T >::type >::type >)}+ ','+tuple_name< T, I+1 >);if(str.back()== ',') str.pop_back();return str;}template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value >=2, detail::enabler > > std::string type_name()
Recursively generate the tuple type name.
static Value CreateTensor(const OrtMemoryInfo *info, T *p_data, size_t p_data_element_count, const int64_t *shape, size_t shape_len)
Creates a tensor with a user supplied buffer. Wraps OrtApi::CreateTensorWithDataAsOrtValue.
GLint GLint GLsizei GLint GLenum format
const OrtApi & GetApi()
This returns a reference to the OrtApi interface in use.
ThreadingOptions & SetGlobalIntraOpNumThreads(int intra_op_num_threads)
Wraps OrtApi::SetGlobalIntraOpNumThreads.
GraphOptimizationLevel
Graph optimization level.
size_t KernelContext_GetOutputCount(const OrtKernelContext *context)
Value GetTensorAttribute(const char *name, OrtAllocator *allocator) const
bool GetVariadicInputHomogeneity() const
void Add(const OrtCustomOp *op)
Wraps CustomOpDomain_Add.
constexpr Float16_t() noexcept
KernelInfo(std::nullptr_t)
Create an empty instance to initialize later.
detail::TypeInfoImpl< detail::Unowned< const OrtTypeInfo >> ConstTypeInfo
Contains a constant, unowned OrtTypeInfo that can be copied and passed around by value. Provides access to const OrtTypeInfo APIs.
OrtCustomOpInputOutputCharacteristic GetOutputCharacteristic(size_t) const
Represents native memory allocation coming from one of the OrtAllocators registered with OnnxRuntime...
Session(std::nullptr_t)
Create an empty Session object, must be assigned a valid one to be used.
ThreadingOptions & SetGlobalDenormalAsZero()
Wraps OrtApi::SetGlobalDenormalAsZero.
IEEE 754 half-precision floating point data type.
SessionOptions(OrtSessionOptions *p)
OpenVINO Provider Options.
Create and own custom defined operation.
size_t GetInputCount() const
SessionOptionsImpl & SetInterOpNumThreads(int inter_op_num_threads)
Wraps OrtApi::SetInterOpNumThreads.
ConstIoBinding GetConst() const
size_t GetOutputCount() const
Options for the TensorRT provider that are passed to SessionOptionsAppendExecutionProvider_TensorRT_V...
R * GetTensorMutableData()
Returns a non-const typed pointer to an OrtValue/Tensor contained buffer No type checking is performe...
SessionOptions()
Wraps OrtApi::CreateSessionOptions.
void * GetGPUComputeStream() const
void BindOutput(const char *name, const Value &)
GLuint const GLchar * name
RunOptions & SetRunTag(const char *run_tag)
wraps OrtApi::RunOptionsSetRunTag
Allocator(std::nullptr_t)
Convenience to create a class member and then replace with an instance.
SessionOptionsImpl & EnableProfiling(const ORTCHAR_T *profile_file_prefix)
Wraps OrtApi::EnableProfiling.
constexpr bool operator!=(const Float16_t &rhs) const noexcept
size_t GetStringTensorDataLength() const
This API returns a full length of string data contained within either a tensor or a sparse Tensor...
ORT_EXPORT const OrtApiBase *ORT_API_CALL OrtGetApiBase(void) NO_EXCEPTION
The Onnxruntime library's entry point to access the C API.
detail::ConstSessionOptionsImpl< detail::Unowned< const OrtSessionOptions >> ConstSessionOptions
RunOptions & SetTerminate()
Terminates all currently executing Session::Run calls that were made using this RunOptions instance...
OrtAllocatorType GetAllocatorType() const
RunOptions(std::nullptr_t)
Create an empty RunOptions object, must be assigned a valid one to be used.
size_t GetInputCount() const
TypeInfo GetSequenceElementType() const
Wraps OrtApi::GetSequenceElementType.
const OrtApi *ORT_API_CALL * GetApi(uint32_t version) NO_EXCEPTION
Get a pointer to the requested version of the OrtApi.
int GetVariadicOutputMinArity() const
static Value CreateSparseTensor(const OrtMemoryInfo *info, T *p_data, const Shape &dense_shape, const Shape &values_shape)
This is a simple forwarding method to the other overload that helps deducing data type enum value fro...
const char *ORT_API_CALL * GetExecutionProviderType(_In_ const struct OrtCustomOp *op)
TypeInfo GetOutputTypeInfo(size_t index) const
Wraps OrtApi::SessionGetOutputTypeInfo.
size_t GetStringTensorElementLength(size_t element_index) const
The API returns a byte length of UTF-8 encoded string element contained in either a tensor or a spare...
AllocatedFree(OrtAllocator *allocator)
SessionOptionsImpl & Add(OrtCustomOpDomain *custom_op_domain)
Wraps OrtApi::AddCustomOpDomain.
ORT_DEFINE_RELEASE(Allocator)
constexpr Base(contained_type *p) noexcept
TensorTypeAndShapeInfo GetSparseTensorValuesTypeAndShapeInfo() const
The API returns type and shape information for stored non-zero values of the sparse tensor...
GT_API const UT_StringHolder version
TypeInfo GetTypeInfo() const
The API returns type information for data contained in a tensor. For sparse tensors it returns type i...
bool GetVariadicOutputHomogeneity() const
RunOptions & SetRunLogSeverityLevel(int)
Wraps OrtApi::RunOptionsSetRunLogSeverityLevel.
ConstTensorTypeAndShapeInfo GetTensorTypeAndShapeInfo() const
Wraps OrtApi::CastTypeInfoToTensorInfo.
TensorRT Provider Options.
bool operator==(const MemoryInfoImpl< U > &o) const
_In_ OrtKernelContext * context
TypeInfo GetMapValueType() const
Wraps OrtApi::GetMapValueType.
RunOptions()
Wraps OrtApi::CreateRunOptions.
OrtTensorTypeAndShapeInfo * GetTensorTypeAndShape(_In_ const OrtValue *value)
This struct owns the OrtKernInfo* pointer when a copy is made. For convenient wrapping of OrtKernelIn...
void FillSparseTensorCoo(const OrtMemoryInfo *data_mem_info, const OrtSparseValuesParam &values_param, const int64_t *indices_data, size_t indices_num)
The API will allocate memory using the allocator instance supplied to the CreateSparseTensor() API an...
std::vector< Value > GetOutputValues() const
OrtAllocator * allocator_
OrtErrorCode GetErrorCode() const
struct OrtKernelInfo OrtKernelInfo
void FillStringTensor(const char *const *s, size_t s_len)
Set all strings at once in a string tensor
KernelContext(OrtKernelContext *context)
constexpr bool operator==(const BFloat16_t &rhs) const noexcept
ArenaCfg(std::nullptr_t)
Create an empty ArenaCfg object, must be assigned a valid one to be used.
ThreadingOptions()
Wraps OrtApi::CreateThreadingOptions.
void ReleaseOpAttr(_Frees_ptr_opt_ OrtOpAttr *op_attr)
GLenum GLsizei GLsizei GLint * values
void operator()(void *ptr) const
void SetDimensions(OrtTensorTypeAndShapeInfo *info, _In_ const int64_t *dim_values, size_t dim_count)
ConstValue GetConst() const
std::string GetOutputName(size_t index) const
static Value CreateMap(Value &keys, Value &values)
Wraps OrtApi::CreateValue.
constexpr Float16_t(uint16_t v) noexcept
void GetSessionConfigs(std::unordered_map< std::string, std::string > &out, ConstSessionOptions options) const
TypeInfo GetOverridableInitializerTypeInfo(size_t index) const
Wraps OrtApi::SessionGetOverridableInitializerTypeInfo.
This entire structure is deprecated, but we not marking it as a whole yet since we want to preserve f...
MemoryInfo(OrtMemoryInfo *p)
SessionOptionsImpl & AddConfigEntry(const char *config_key, const char *config_value)
Wraps OrtApi::AddSessionConfigEntry.
Memory allocation interface.
OrtOp * CreateOp(_In_ const OrtKernelInfo *info, _In_ const char *op_name, _In_ const char *domain, _In_ int version, _In_opt_ const char **type_constraint_names, _In_opt_ const ONNXTensorElementDataType *type_constraint_values, _In_opt_ int type_constraint_count, _In_opt_ const OrtOpAttr *const *attr_values, _In_opt_ int attr_count, _In_ int input_count, _In_ int output_count)
SessionOptionsImpl & SetExecutionMode(ExecutionMode execution_mode)
Wraps OrtApi::SetSessionExecutionMode.
AllocatorWithDefaultOptions()
AllocatedStringPtr EndProfilingAllocated(OrtAllocator *allocator)
End profiling and return a copy of the profiling file name.
SessionOptionsImpl & AppendExecutionProvider(const std::string &provider_name, const std::unordered_map< std::string, std::string > &provider_options={})
Wraps OrtApi::SessionOptionsAppendExecutionProvider. Currently supports SNPE and XNNPACK.
SessionOptionsImpl & DisableProfiling()
Wraps OrtApi::DisableProfiling.
OrtValue * KernelContext_GetOutput(OrtKernelContext *context, _In_ size_t index, _In_ const int64_t *dim_values, size_t dim_count)
RunOptions & UnsetTerminate()
Clears the terminate flag so this RunOptions instance can be used in a new Session::Run call without ...
size_t GetOverridableInitializerCount() const
Returns the number of inputs that have defaults that can be overridden.
const char * GetRunTag() const
Wraps OrtApi::RunOptionsGetRunTag.
int GetRunLogVerbosityLevel() const
Wraps OrtApi::RunOptionsGetRunLogVerbosityLevel.
std::vector< std::string > GetSessionConfigKeys() const
OrtErrorCode GetOrtErrorCode() const
size_t GetOutputCount() const
Returns the number of model outputs.
SessionOptionsImpl & AddExternalInitializers(const std::vector< std::string > &names, const std::vector< Value > &ort_values)
Wraps OrtApi::AddExternalInitializers.
TensorTypeAndShapeInfo GetTensorTypeAndShapeInfo() const
The API returns type information for data contained in a tensor. For sparse tensors it returns type i...
Base & operator=(Base &&v) noexcept
ONNXTensorElementDataType
int GetRunLogSeverityLevel() const
Wraps OrtApi::RunOptionsGetRunLogSeverityLevel.
ConstMemoryInfo GetTensorMemoryInfo() const
This API returns information about the memory allocation used to hold data.
AllocatedStringPtr GetInputNameAllocated(size_t index, OrtAllocator *allocator) const
Returns a copy of input name at the specified index.
Wrapper around ::OrtTensorTypeAndShapeInfo.
MemoryInfo(std::nullptr_t)
No instance is created.
Exception(std::string &&string, OrtErrorCode code)
std::string MakeCustomOpConfigEntryKey(const char *custom_op_name, const char *config)
CustomOpConfigs.
size_t GetCount() const
< Return true if OrtValue contains data and returns false if the OrtValue is a None ...
MapTypeInfo(std::nullptr_t)
Create an empty MapTypeInfo object, must be assigned a valid one to be used.
std::string GetInputName(size_t index) const
ThreadingOptions & SetGlobalCustomCreateThreadFn(OrtCustomCreateThreadFn ort_custom_create_thread_fn)
Wraps OrtApi::SetGlobalCustomCreateThreadFn.
Wrapper around ::OrtSessionOptions.
OrtSparseFormat GetSparseFormat() const
The API returns the sparse data format this OrtValue holds in a sparse tensor. If the sparse tensor w...
void UseCooIndices(int64_t *indices_data, size_t indices_num)
Supplies COO format specific indices and marks the contained sparse tensor as being a COO format tens...
contained_type * release()
Relinquishes ownership of the contained C object pointer The underlying object is not destroyed...
MemoryAllocation(OrtAllocator *allocator, void *p, size_t size)
CustomOpConfigs & AddConfig(const char *custom_op_name, const char *config_key, const char *config_value)
Adds a session configuration entry/value for a specific custom operator.
SessionOptions(std::nullptr_t)
Create an empty SessionOptions object, must be assigned a valid one to be used.
Base & operator=(const Base &)=delete
void(* OrtCustomJoinThreadFn)(OrtCustomThreadHandle ort_custom_thread_handle)
Custom thread join function.
void ThrowOnError(OrtStatus *result)
TypeInfo GetInputTypeInfo(size_t index) const
SessionOptionsImpl & SetLogSeverityLevel(int level)
Wraps OrtApi::SetSessionLogSeverityLevel.
UnownedValue GetUnowned() const
R GetAttribute(const char *name) const
Wrapper around OrtAllocator default instance that is owned by Onnxruntime.
Wrapper around ::OrtSession.
SessionOptionsImpl & DisableMemPattern()
Wraps OrtApi::DisableMemPattern.
SessionOptionsImpl & AppendExecutionProvider_ROCM(const OrtROCMProviderOptions &provider_options)
Wraps OrtApi::SessionOptionsAppendExecutionProvider_ROCM.
~CustomOpConfigs()=default
Options for the CUDA provider that are passed to SessionOptionsAppendExecutionProvider_CUDA_V2. Please note that this struct is similar to OrtCUDAProviderOptions but only to be used internally. Going forward, new cuda provider options are to be supported via this struct and usage of the publicly defined OrtCUDAProviderOptions will be deprecated over time. User can only get the instance of OrtCUDAProviderOptionsV2 via CreateCUDAProviderOptions.
RunOptions & SetRunLogVerbosityLevel(int)
Wraps OrtApi::RunOptionsSetRunLogVerbosityLevel.
ThreadingOptions & SetGlobalCustomThreadCreationOptions(void *ort_custom_thread_creation_options)
Wraps OrtApi::SetGlobalCustomThreadCreationOptions.
struct OrtKernelContext OrtKernelContext
const char *ORT_API_CALL * GetName(_In_ const struct OrtCustomOp *op)
bfloat16 (Brain Floating Point) data type
ConstKernelInfo GetConst() const
constexpr FMT_INLINE value()
OrtLoggingLevel
Logging severity levels.
SequenceTypeInfo(std::nullptr_t)
Create an empty SequenceTypeInfo object, must be assigned a valid one to be used. ...
Class that represents session configuration entries for one or more custom operators.
Value & operator=(Value &&)=default
size_t KernelContext_GetInputCount(const OrtKernelContext *context)
std::vector< std::string > GetOutputNamesHelper(const OrtIoBinding *binding, OrtAllocator *)
ConstTensorTypeAndShapeInfo GetConst() const
OrtMemType
Memory types for allocated memory, execution provider specific types should be extended in each provi...
SessionOptionsImpl & RegisterCustomOpsLibrary(const ORTCHAR_T *library_name, const CustomOpConfigs &custom_op_configs={})
T KernelInfoGetAttribute(_In_ const OrtKernelInfo *info, _In_ const char *name)
ConstSequenceTypeInfo GetSequenceTypeInfo() const
Wraps OrtApi::CastTypeInfoToSequenceTypeInfo.
UnownedIoBinding GetUnowned() const
MIGraphX Provider Options.