HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
data_types.h File Reference
#include <cstdint>
#include <cstring>
#include <string>
#include <type_traits>
#include <map>
#include <unordered_map>
#include "core/common/gsl.h"
#include "core/common/common.h"
#include "core/common/exceptions.h"
#include "core/framework/endian.h"
#include "core/framework/float8.h"
#include "core/framework/float16.h"
#include "core/graph/onnx_protobuf.h"
#include "core/framework/to_tensor_proto_element_type.h"
+ Include dependency graph for data_types.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  onnxruntime::DataTypeImpl
 Base class for MLDataType. More...
 
struct  onnxruntime::data_types_internal::IsAnyOf< T, Types >
 
struct  onnxruntime::data_types_internal::IsAnyOf< T, Tail >
 Two types remaining, end of the list. More...
 
struct  onnxruntime::data_types_internal::IsAnyOf< T, H, Tail...>
 
struct  onnxruntime::data_types_internal::IsTensorContainedType< T >
 
struct  onnxruntime::data_types_internal::IsSparseTensorContainedType< T >
 
struct  onnxruntime::data_types_internal::IsOptionalOrtType< T >
 
struct  onnxruntime::data_types_internal::GetMLDataType< T, TensorContainedType >
 
struct  onnxruntime::data_types_internal::GetMLDataType< T, true >
 
struct  onnxruntime::data_types_internal::GetMLDataType< T, false >
 
struct  onnxruntime::data_types_internal::TensorTypeHelper
 
struct  onnxruntime::data_types_internal::SparseTensorTypeHelper
 
struct  onnxruntime::data_types_internal::MapTypeHelper
 
struct  onnxruntime::data_types_internal::SequenceTypeHelper
 
struct  onnxruntime::data_types_internal::OptionalTypeHelper
 
class  onnxruntime::TensorTypeBase
 All tensors base. More...
 
class  onnxruntime::TensorType< elemT >
 Tensor type. This type does not have a C++ type associated with it at registration time except the element type. One of the types mentioned above at IsTensorContainedType<> list is acceptable. More...
 
class  onnxruntime::SparseTensorTypeBase
 Common base-class for all sparse-tensors (with different element types). More...
 
class  onnxruntime::SparseTensorType< elemT >
 
class  onnxruntime::OptionalTypeBase
 Common base-class for all optional types. More...
 
class  onnxruntime::OptionalType< T, elemT >
 
struct  onnxruntime::NonTensorTypeConverter< T >
 Provide a specialization for your C++ Non-tensor type so your implementation FromDataTypeContainer/ToDataTypeContainer functions correctly. Otherwise you get a default implementation which may not be what you need/want. More...
 
class  onnxruntime::NonTensorTypeBase
 Base type for all non-tensors, maps, sequences and opaques. More...
 
class  onnxruntime::NonTensorType< T >
 
class  onnxruntime::MapType< CPPType >
 MapType. Use this type to register mapping types. More...
 
class  onnxruntime::SequenceType< CPPType >
 SequenceType. Use to register sequence for non-tensor types. More...
 
class  onnxruntime::SequenceTensorTypeBase
 SequenceTensorTypeBase serves as a base type class for Tensor sequences. Akin to TensorTypeBase. Runtime representation is always TensorSeq. More...
 
class  onnxruntime::SequenceTensorType< TensorElemType >
 SequenceTensorType. Use to register sequence for non-tensor types. More...
 
class  onnxruntime::OpaqueType< T, D, N >
 OpaqueType. More...
 
class  onnxruntime::PrimitiveDataTypeBase
 PrimitiveDataTypeBase Base class for primitive Tensor contained types. More...
 
class  onnxruntime::PrimitiveDataType< T >
 PrimitiveDataType Typed specialization for primitive types. Concrete instances of this class are used by Tensor. More...
 

Namespaces

 ONNX_NAMESPACE
 
 onnxruntime
 
 onnxruntime::data_types_internal
 

Macros

#define ORT_REGISTER_TENSOR_TYPE(ELEM_TYPE)
 
#define ORT_REGISTER_SPARSE_TENSOR_TYPE(ELEM_TYPE)
 
#define ORT_REGISTER_OPTIONAL_TYPE(ORT_TYPE, TYPE)
 
#define ORT_REGISTER_MAP(TYPE)
 
#define ORT_REGISTER_SEQ(TYPE)
 
#define ORT_REGISTER_SEQ_TENSOR_TYPE(ELEM_TYPE)
 
#define ORT_REGISTER_PRIM_TYPE(TYPE)
 
#define ORT_REGISTER_OPAQUE_TYPE(CPPType, Domain, Name)
 

Typedefs

using onnxruntime::MapStringToString = std::map< std::string, std::string >
 Predefined registered types. More...
 
using onnxruntime::MapStringToInt64 = std::map< std::string, int64_t >
 
using onnxruntime::MapStringToFloat = std::map< std::string, float >
 
using onnxruntime::MapStringToDouble = std::map< std::string, double >
 
using onnxruntime::MapInt64ToString = std::map< int64_t, std::string >
 
using onnxruntime::MapInt64ToInt64 = std::map< int64_t, int64_t >
 
using onnxruntime::MapInt64ToFloat = std::map< int64_t, float >
 
using onnxruntime::MapInt64ToDouble = std::map< int64_t, double >
 
using onnxruntime::VectorMapStringToFloat = std::vector< MapStringToFloat >
 
using onnxruntime::VectorMapInt64ToFloat = std::vector< MapInt64ToFloat >
 
using onnxruntime::VectorString = std::vector< std::string >
 
using onnxruntime::VectorInt64 = std::vector< int64_t >
 
using onnxruntime::MLDataType = const DataTypeImpl *
 
using onnxruntime::DeleteFunc = void(*)(void *)
 
using onnxruntime::CreateFunc ) = void *(*)(
 

Functions

std::ostream & onnxruntime::operator<< (std::ostream &out, MLDataType data_type)
 
void onnxruntime::data_types_internal::CopyMutableMapValue (const ONNX_NAMESPACE::TypeProto &, ONNX_NAMESPACE::TypeProto &)
 Map helpers. More...
 
void onnxruntime::data_types_internal::CopyMutableSeqElement (const ONNX_NAMESPACE::TypeProto &, ONNX_NAMESPACE::TypeProto &)
 Sequence helpers. More...
 
void onnxruntime::data_types_internal::CopyMutableOptionalElement (const ONNX_NAMESPACE::TypeProto &, ONNX_NAMESPACE::TypeProto &)
 Optional helpers. More...
 
void onnxruntime::data_types_internal::AssignOpaqueDomainName (const char *domain, const char *name, ONNX_NAMESPACE::TypeProto &proto)
 OpaqueTypes helpers. More...
 

Macro Definition Documentation

#define ORT_REGISTER_MAP (   TYPE)
Value:
template <> \
static MapType<TYPE> map_type; \
return &map_type; \
} \
template <> \
MLDataType DataTypeImpl::GetType<TYPE>() { \
return MapType<TYPE>::Type(); \
}
const DataTypeImpl * MLDataType
Definition: data_types.h:67

Definition at line 1043 of file data_types.h.

#define ORT_REGISTER_OPAQUE_TYPE (   CPPType,
  Domain,
  Name 
)
Value:
template <> \
static OpaqueType<CPPType, Domain, Name> opaque_type; \
return &opaque_type; \
} \
template <> \
MLDataType DataTypeImpl::GetType<CPPType>() { \
}
const DataTypeImpl * MLDataType
Definition: data_types.h:67

Definition at line 1088 of file data_types.h.

#define ORT_REGISTER_OPTIONAL_TYPE (   ORT_TYPE,
  TYPE 
)
Value:
template <> \
static OptionalType<ORT_TYPE, TYPE> optional_type; \
return &optional_type; \
} \
template <> \
MLDataType DataTypeImpl::GetOptionalType<ORT_TYPE, TYPE>() { \
}
const DataTypeImpl * MLDataType
Definition: data_types.h:67

Definition at line 1031 of file data_types.h.

#define ORT_REGISTER_PRIM_TYPE (   TYPE)
Value:
template <> \
static PrimitiveDataType<TYPE> prim_data_type; \
return &prim_data_type; \
} \
template <> \
MLDataType DataTypeImpl::GetType<TYPE>() { \
}
const DataTypeImpl * MLDataType
Definition: data_types.h:67

Definition at line 1077 of file data_types.h.

#define ORT_REGISTER_SEQ (   TYPE)
Value:
template <> \
static SequenceType<TYPE> sequence_type; \
return &sequence_type; \
} \
template <> \
MLDataType DataTypeImpl::GetType<TYPE>() { \
}
const DataTypeImpl * MLDataType
Definition: data_types.h:67

Definition at line 1055 of file data_types.h.

#define ORT_REGISTER_SEQ_TENSOR_TYPE (   ELEM_TYPE)
Value:
template <> \
static SequenceTensorType<ELEM_TYPE> sequence_tensor_type; \
return &sequence_tensor_type; \
} \
template <> \
MLDataType DataTypeImpl::GetSequenceTensorType<ELEM_TYPE>() { \
}
const DataTypeImpl * MLDataType
Definition: data_types.h:67

Definition at line 1066 of file data_types.h.

#define ORT_REGISTER_SPARSE_TENSOR_TYPE (   ELEM_TYPE)
Value:
template <> \
static SparseTensorType<ELEM_TYPE> tensor_type; \
return &tensor_type; \
} \
template <> \
MLDataType DataTypeImpl::GetSparseTensorType<ELEM_TYPE>() { \
}
const DataTypeImpl * MLDataType
Definition: data_types.h:67

Definition at line 1019 of file data_types.h.

#define ORT_REGISTER_TENSOR_TYPE (   ELEM_TYPE)
Value:
template <> \
static TensorType<ELEM_TYPE> tensor_type; \
return &tensor_type; \
} \
template <> \
MLDataType DataTypeImpl::GetTensorType<ELEM_TYPE>() { \
}
const DataTypeImpl * MLDataType
Definition: data_types.h:67

Definition at line 1007 of file data_types.h.