ONNX Runtime
Loading...
Searching...
No Matches
Ort::Session Struct Reference

Wrapper around OrtSession. More...

#include <onnxruntime_cxx_api.h>

Inheritance diagram for Ort::Session:
Ort::detail::SessionImpl< OrtSession > Ort::detail::ConstSessionImpl< T > Ort::detail::Base< T >

Public Member Functions

 Session (std::nullptr_t)
 Create an empty Session object, must be assigned a valid one to be used.
 
 Session (const Env &env, const char *model_path, const SessionOptions &options)
 Wraps OrtApi::CreateSession.
 
 Session (const Env &env, const char *model_path, const SessionOptions &options, OrtPrepackedWeightsContainer *prepacked_weights_container)
 Wraps OrtApi::CreateSessionWithPrepackedWeightsContainer.
 
 Session (const Env &env, const void *model_data, size_t model_data_length, const SessionOptions &options)
 Wraps OrtApi::CreateSessionFromArray.
 
 Session (const Env &env, const void *model_data, size_t model_data_length, const SessionOptions &options, OrtPrepackedWeightsContainer *prepacked_weights_container)
 Wraps OrtApi::CreateSessionFromArrayWithPrepackedWeightsContainer.
 
ConstSession GetConst () const
 
UnownedSession GetUnowned () const
 
- Public Member Functions inherited from Ort::detail::SessionImpl< OrtSession >
std::vector< ValueRun (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 Run (const RunOptions &run_options, const char *const *input_names, const Value *input_values, size_t input_count, const char *const *output_names, Value *output_values, size_t output_count)
 Run the model returning results in user provided outputs Same as Run(const RunOptions&, const char* const*, const Value*, size_t,const char* const*, size_t)
 
void Run (const RunOptions &run_options, const IoBinding &)
 Wraps OrtApi::RunWithBinding.
 
void RunAsync (const RunOptions &run_options, const char *const *input_names, const Value *input_values, size_t input_count, const char *const *output_names, Value *output_values, size_t output_count, RunAsyncCallbackFn callback, void *user_data)
 Run the model asynchronously in a thread owned by intra op thread pool.
 
AllocatedStringPtr EndProfilingAllocated (OrtAllocator *allocator)
 End profiling and return a copy of the profiling file name.
 
void SetEpDynamicOptions (const char *const *keys, const char *const *values, size_t kv_len)
 Set DynamicOptions for EPs (Execution Providers)
 
- Public Member Functions inherited from Ort::detail::ConstSessionImpl< T >
size_t GetInputCount () const
 Returns the number of model inputs.
 
size_t GetOutputCount () const
 Returns the number of model outputs.
 
size_t GetOverridableInitializerCount () const
 Returns the number of inputs that have defaults that can be overridden.
 
AllocatedStringPtr GetInputNameAllocated (size_t index, OrtAllocator *allocator) const
 Returns a copy of input name at the specified index.
 
AllocatedStringPtr GetOutputNameAllocated (size_t index, OrtAllocator *allocator) const
 Returns a copy of output name at then specified index.
 
AllocatedStringPtr GetOverridableInitializerNameAllocated (size_t index, OrtAllocator *allocator) const
 Returns a copy of the overridable initializer name at then specified index.
 
uint64_t GetProfilingStartTimeNs () const
 Wraps OrtApi::SessionGetProfilingStartTimeNs.
 
ModelMetadata GetModelMetadata () const
 Wraps OrtApi::SessionGetModelMetadata.
 
TypeInfo GetInputTypeInfo (size_t index) const
 Wraps OrtApi::SessionGetInputTypeInfo.
 
TypeInfo GetOutputTypeInfo (size_t index) const
 Wraps OrtApi::SessionGetOutputTypeInfo.
 
TypeInfo GetOverridableInitializerTypeInfo (size_t index) const
 Wraps OrtApi::SessionGetOverridableInitializerTypeInfo.
 
- Public Member Functions inherited from Ort::detail::Base< T >
constexpr Base ()=default
 
constexpr Base (contained_type *p) noexcept
 
 ~Base ()
 
 Base (const Base &)=delete
 
Baseoperator= (const Base &)=delete
 
 Base (Base &&v) noexcept
 
Baseoperator= (Base &&v) noexcept
 
constexpr operator contained_type * () const noexcept
 
contained_typerelease ()
 Relinquishes ownership of the contained C object pointer The underlying object is not destroyed.
 

Additional Inherited Members

- Public Types inherited from Ort::detail::SessionImpl< OrtSession >
using B = ConstSessionImpl< OrtSession >
 
using B = Base< OrtSession >
 
- Public Types inherited from Ort::detail::ConstSessionImpl< T >
using B = Base< T >
 
- Public Types inherited from Ort::detail::Base< T >
using contained_type = T
 
- Protected Attributes inherited from Ort::detail::Base< T >
contained_typep_ {}
 

Detailed Description

Wrapper around OrtSession.

Constructor & Destructor Documentation

◆ Session() [1/5]

Ort::Session::Session ( std::nullptr_t  )
inlineexplicit

Create an empty Session object, must be assigned a valid one to be used.

◆ Session() [2/5]

Ort::Session::Session ( const Env env,
const char *  model_path,
const SessionOptions options 
)

◆ Session() [3/5]

Ort::Session::Session ( const Env env,
const char *  model_path,
const SessionOptions options,
OrtPrepackedWeightsContainer prepacked_weights_container 
)

◆ Session() [4/5]

Ort::Session::Session ( const Env env,
const void *  model_data,
size_t  model_data_length,
const SessionOptions options 
)

◆ Session() [5/5]

Ort::Session::Session ( const Env env,
const void *  model_data,
size_t  model_data_length,
const SessionOptions options,
OrtPrepackedWeightsContainer prepacked_weights_container 
)

Member Function Documentation

◆ GetConst()

ConstSession Ort::Session::GetConst ( ) const
inline

◆ GetUnowned()

UnownedSession Ort::Session::GetUnowned ( ) const
inline