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

Wrapper around OrtModelMetadata. More...

#include <onnxruntime_cxx_api.h>

Inheritance diagram for Ort::ModelMetadata:
Ort::detail::Base< OrtModelMetadata >

Public Member Functions

 ModelMetadata (std::nullptr_t)
 Create an empty ModelMetadata object, must be assigned a valid one to be used.
 
 ModelMetadata (OrtModelMetadata *p)
 Used for interop with the C API.
 
AllocatedStringPtr GetProducerNameAllocated (OrtAllocator *allocator) const
 Returns a copy of the producer name.
 
AllocatedStringPtr GetGraphNameAllocated (OrtAllocator *allocator) const
 Returns a copy of the graph name.
 
AllocatedStringPtr GetDomainAllocated (OrtAllocator *allocator) const
 Returns a copy of the domain name.
 
AllocatedStringPtr GetDescriptionAllocated (OrtAllocator *allocator) const
 Returns a copy of the description.
 
AllocatedStringPtr GetGraphDescriptionAllocated (OrtAllocator *allocator) const
 Returns a copy of the graph description.
 
std::vector< AllocatedStringPtrGetCustomMetadataMapKeysAllocated (OrtAllocator *allocator) const
 Returns a vector of copies of the custom metadata keys.
 
AllocatedStringPtr LookupCustomMetadataMapAllocated (const char *key, OrtAllocator *allocator) const
 Looks up a value by a key in the Custom Metadata map.
 
int64_t GetVersion () const
 Wraps OrtApi::ModelMetadataGetVersion.
 
- Public Member Functions inherited from Ort::detail::Base< OrtModelMetadata >
constexpr Base ()=default
 
constexpr Base (contained_type *p) noexcept
 
 Base (const Base &)=delete
 
 Base (Base &&v) noexcept
 
 ~Base ()
 
Baseoperator= (const Base &)=delete
 
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::Base< OrtModelMetadata >
using contained_type = OrtModelMetadata
 
- Protected Attributes inherited from Ort::detail::Base< OrtModelMetadata >
contained_typep_
 

Detailed Description

Wrapper around OrtModelMetadata.

Constructor & Destructor Documentation

◆ ModelMetadata() [1/2]

Ort::ModelMetadata::ModelMetadata ( std::nullptr_t  )
inlineexplicit

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

◆ ModelMetadata() [2/2]

Ort::ModelMetadata::ModelMetadata ( OrtModelMetadata p)
inlineexplicit

Used for interop with the C API.

Member Function Documentation

◆ GetCustomMetadataMapKeysAllocated()

std::vector< AllocatedStringPtr > Ort::ModelMetadata::GetCustomMetadataMapKeysAllocated ( OrtAllocator allocator) const

Returns a vector of copies of the custom metadata keys.

Parameters
allocatorto allocate memory for the copy of the string returned
Returns
a instance std::vector of smart pointers that would deallocate the buffers when out of scope. The OrtAllocator instance must be valid at the point of memory release. Wraps OrtApi::ModelMetadataGetCustomMetadataMapKeys

◆ GetDescriptionAllocated()

AllocatedStringPtr Ort::ModelMetadata::GetDescriptionAllocated ( OrtAllocator allocator) const

Returns a copy of the description.

Parameters
allocatorto allocate memory for the copy of the string returned
Returns
a instance of smart pointer that would deallocate the buffer when out of scope. The OrtAllocator instances must be valid at the point of memory release. Wraps OrtApi::ModelMetadataGetDescription

◆ GetDomainAllocated()

AllocatedStringPtr Ort::ModelMetadata::GetDomainAllocated ( OrtAllocator allocator) const

Returns a copy of the domain name.

Parameters
allocatorto allocate memory for the copy of the name returned
Returns
a instance of smart pointer that would deallocate the buffer when out of scope. The OrtAllocator instances must be valid at the point of memory release. Wraps OrtApi::ModelMetadataGetDomain

◆ GetGraphDescriptionAllocated()

AllocatedStringPtr Ort::ModelMetadata::GetGraphDescriptionAllocated ( OrtAllocator allocator) const

Returns a copy of the graph description.

Parameters
allocatorto allocate memory for the copy of the string returned
Returns
a instance of smart pointer that would deallocate the buffer when out of scope. The OrtAllocator instances must be valid at the point of memory release. Wraps OrtApi::ModelMetadataGetGraphDescription

◆ GetGraphNameAllocated()

AllocatedStringPtr Ort::ModelMetadata::GetGraphNameAllocated ( OrtAllocator allocator) const

Returns a copy of the graph name.

Parameters
allocatorto allocate memory for the copy of the name returned
Returns
a instance of smart pointer that would deallocate the buffer when out of scope. The OrtAllocator instances must be valid at the point of memory release. Wraps OrtApi::ModelMetadataGetGraphName

◆ GetProducerNameAllocated()

AllocatedStringPtr Ort::ModelMetadata::GetProducerNameAllocated ( OrtAllocator allocator) const

Returns a copy of the producer name.

Parameters
allocatorto allocate memory for the copy of the name returned
Returns
a instance of smart pointer that would deallocate the buffer when out of scope. The OrtAllocator instances must be valid at the point of memory release. Wraps OrtApi::ModelMetadataGetProducerName

◆ GetVersion()

int64_t Ort::ModelMetadata::GetVersion ( ) const

◆ LookupCustomMetadataMapAllocated()

AllocatedStringPtr Ort::ModelMetadata::LookupCustomMetadataMapAllocated ( const char *  key,
OrtAllocator allocator 
) const

Looks up a value by a key in the Custom Metadata map.

Parameters
keyzero terminated string key to lookup
allocatorto allocate memory for the copy of the string returned
Returns
a instance of smart pointer that would deallocate the buffer when out of scope. maybe nullptr if key is not found.

The OrtAllocator instances must be valid at the point of memory release. Wraps OrtApi::ModelMetadataLookupCustomMetadataMap