HDK
|
Base class for MLDataType. More...
#include <data_types.h>
Public Types | |
enum | GeneralType { GeneralType::kInvalid = 0, GeneralType::kNonTensor = 1, GeneralType::kTensor = 2, GeneralType::kTensorSequence = 3, GeneralType::kSparseTensor = 4, GeneralType::kOptional = 5, GeneralType::kPrimitive = 6 } |
Public Member Functions | |
virtual | ~DataTypeImpl ()=default |
virtual bool | IsCompatible (const ONNX_NAMESPACE::TypeProto &type_proto) const =0 |
this API will be used to check type compatibility at runtime More... | |
size_t | Size () const |
virtual DeleteFunc | GetDeleteFunc () const =0 |
virtual const ONNX_NAMESPACE::TypeProto * | GetTypeProto () const =0 |
Retrieves an instance of TypeProto for a given MLDataType. More... | |
bool | IsTensorType () const |
bool | IsTensorSequenceType () const |
bool | IsSparseTensorType () const |
bool | IsOptionalType () const |
bool | IsNonTensorType () const |
bool | IsPrimitiveDataType () const |
const TensorTypeBase * | AsTensorType () const |
const SequenceTensorTypeBase * | AsSequenceTensorType () const |
const SparseTensorTypeBase * | AsSparseTensorType () const |
const OptionalTypeBase * | AsOptionalType () const |
const NonTensorTypeBase * | AsNonTensorType () const |
const PrimitiveDataTypeBase * | AsPrimitiveDataType () const |
Public Attributes | |
const GeneralType | type_ |
const size_t | size_ |
Protected Member Functions | |
DataTypeImpl (GeneralType type, size_t size) | |
Base class for MLDataType.
Definition at line 76 of file data_types.h.
|
strong |
Enumerator | |
---|---|
kInvalid | |
kNonTensor | |
kTensor | |
kTensorSequence | |
kSparseTensor | |
kOptional | |
kPrimitive |
Definition at line 78 of file data_types.h.
|
inlineprotected |
Definition at line 92 of file data_types.h.
|
virtualdefault |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
inline |
Definition at line 994 of file data_types.h.
|
inline |
Definition at line 989 of file data_types.h.
|
inline |
Definition at line 998 of file data_types.h.
|
inline |
Definition at line 978 of file data_types.h.
|
inline |
Definition at line 983 of file data_types.h.
|
inline |
Definition at line 974 of file data_types.h.
|
static |
|
pure virtual |
|
static |
|
static |
|
static |
|
static |
|
static |
|
pure virtual |
Retrieves an instance of TypeProto for a given MLDataType.
Implemented in onnxruntime::PrimitiveDataTypeBase, onnxruntime::SequenceTensorTypeBase, onnxruntime::NonTensorTypeBase, onnxruntime::OptionalTypeBase, onnxruntime::SparseTensorTypeBase, and onnxruntime::TensorTypeBase.
|
pure virtual |
this API will be used to check type compatibility at runtime
type_proto | a TypeProto instance that is constructed for a specific type will be checked against a TypeProto instance contained within a corresponding MLDataType instance. |
Implemented in onnxruntime::PrimitiveDataTypeBase, onnxruntime::OpaqueType< T, D, N >, onnxruntime::SequenceTensorTypeBase, onnxruntime::SequenceType< CPPType >, onnxruntime::MapType< CPPType >, onnxruntime::OptionalTypeBase, onnxruntime::SparseTensorTypeBase, and onnxruntime::TensorTypeBase.
|
inline |
Definition at line 134 of file data_types.h.
|
inline |
Definition at line 130 of file data_types.h.
|
inline |
Definition at line 138 of file data_types.h.
|
inline |
Definition at line 126 of file data_types.h.
|
inline |
Definition at line 122 of file data_types.h.
|
inline |
Definition at line 118 of file data_types.h.
|
static |
|
static |
|
inline |
Definition at line 106 of file data_types.h.
|
static |
|
static |
|
static |
|
static |
|
static |
Convert an ONNX TypeProto to onnxruntime DataTypeImpl. However, this conversion is lossy. Don't try to use 'this->GetTypeProto()' converting it back. Even though GetTypeProto() will not have the original information, it will still have enough to correctly map to MLDataType.
proto |
const size_t onnxruntime::DataTypeImpl::size_ |
Definition at line 89 of file data_types.h.
const GeneralType onnxruntime::DataTypeImpl::type_ |
Definition at line 88 of file data_types.h.