HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
onnxruntime::PrimitiveDataTypeBase Class Reference

PrimitiveDataTypeBase Base class for primitive Tensor contained types. More...

#include <data_types.h>

+ Inheritance diagram for onnxruntime::PrimitiveDataTypeBase:

Public Member Functions

bool IsCompatible (const ONNX_NAMESPACE::TypeProto &) const override
 this API will be used to check type compatibility at runtime More...
 
const ONNX_NAMESPACE::TypeProto * GetTypeProto () const final
 Retrieves an instance of TypeProto for a given MLDataType. More...
 
int32_t GetDataType () const
 
- Public Member Functions inherited from onnxruntime::DataTypeImpl
virtual ~DataTypeImpl ()=default
 
size_t Size () const
 
virtual DeleteFunc GetDeleteFunc () const =0
 
bool IsTensorType () const
 
bool IsTensorSequenceType () const
 
bool IsSparseTensorType () const
 
bool IsOptionalType () const
 
bool IsNonTensorType () const
 
bool IsPrimitiveDataType () const
 
const TensorTypeBaseAsTensorType () const
 
const SequenceTensorTypeBaseAsSequenceTensorType () const
 
const SparseTensorTypeBaseAsSparseTensorType () const
 
const OptionalTypeBaseAsOptionalType () const
 
const NonTensorTypeBaseAsNonTensorType () const
 
const PrimitiveDataTypeBaseAsPrimitiveDataType () const
 

Protected Member Functions

 PrimitiveDataTypeBase (size_t size, int32_t data_type)
 
- Protected Member Functions inherited from onnxruntime::DataTypeImpl
 DataTypeImpl (GeneralType type, size_t size)
 

Additional Inherited Members

- Public Types inherited from onnxruntime::DataTypeImpl
enum  GeneralType {
  GeneralType::kInvalid = 0, GeneralType::kNonTensor = 1, GeneralType::kTensor = 2, GeneralType::kTensorSequence = 3,
  GeneralType::kSparseTensor = 4, GeneralType::kOptional = 5, GeneralType::kPrimitive = 6
}
 
- Static Public Member Functions inherited from onnxruntime::DataTypeImpl
template<typename T >
static MLDataType GetType ()
 
template<typename elemT >
static MLDataType GetTensorType ()
 
template<typename elemT >
static MLDataType GetSequenceTensorType ()
 
template<typename elemT >
static MLDataType GetSparseTensorType ()
 
template<typename T , typename elemT >
static MLDataType GetOptionalType ()
 
static MLDataType TypeFromProto (const ONNX_NAMESPACE::TypeProto &proto)
 
static const TensorTypeBaseTensorTypeFromONNXEnum (int type)
 
static const
SequenceTensorTypeBase
SequenceTensorTypeFromONNXEnum (int type)
 
static const SparseTensorTypeBaseSparseTensorTypeFromONNXEnum (int type)
 
static const char * ToString (MLDataType type)
 
static std::vector< std::stringToString (const std::vector< MLDataType > &types)
 
static void RegisterDataType (MLDataType)
 
static MLDataType GetDataType (const std::string &)
 
static const std::vector
< MLDataType > & 
AllTensorTypes ()
 
static const std::vector
< MLDataType > & 
AllFixedSizeTensorTypes ()
 
static const std::vector
< MLDataType > & 
AllSequenceTensorTypes ()
 
static const std::vector
< MLDataType > & 
AllFixedSizeSequenceTensorTypes ()
 
static const std::vector
< MLDataType > & 
AllNumericTensorTypes ()
 
static const std::vector
< MLDataType > & 
AllIEEEFloatTensorTypes ()
 
static const std::vector
< MLDataType > & 
AllFixedSizeTensorExceptHalfTypes ()
 
static const std::vector
< MLDataType > & 
AllIEEEFloatTensorExceptHalfTypes ()
 
static const std::vector
< MLDataType > & 
AllTensorAndSequenceTensorTypes ()
 
static const std::vector
< MLDataType > & 
AllFixedSizeTensorAndSequenceTensorTypes ()
 
static const std::vector
< MLDataType > & 
AllOptionalTypes ()
 
static const std::vector
< MLDataType > & 
AllTensorAndSequenceTensorAndOptionalTypes ()
 
- Public Attributes inherited from onnxruntime::DataTypeImpl
const GeneralType type_
 
const size_t size_
 

Detailed Description

PrimitiveDataTypeBase Base class for primitive Tensor contained types.

This class contains an integer constant that can be used for input data type dispatching

Definition at line 887 of file data_types.h.

Constructor & Destructor Documentation

onnxruntime::PrimitiveDataTypeBase::PrimitiveDataTypeBase ( size_t  size,
int32_t  data_type 
)
inlineprotected

Definition at line 902 of file data_types.h.

Member Function Documentation

int32_t onnxruntime::PrimitiveDataTypeBase::GetDataType ( ) const
inline

Definition at line 897 of file data_types.h.

const ONNX_NAMESPACE::TypeProto* onnxruntime::PrimitiveDataTypeBase::GetTypeProto ( ) const
inlinefinalvirtual

Retrieves an instance of TypeProto for a given MLDataType.

Returns
optional TypeProto. Only ONNX types has type proto, non-ONNX types will return nullptr.

Implements onnxruntime::DataTypeImpl.

Definition at line 893 of file data_types.h.

bool onnxruntime::PrimitiveDataTypeBase::IsCompatible ( const ONNX_NAMESPACE::TypeProto &  type_proto) const
inlineoverridevirtual

this API will be used to check type compatibility at runtime

Parameters
type_protoa TypeProto instance that is constructed for a specific type will be checked against a TypeProto instance contained within a corresponding MLDataType instance.

Implements onnxruntime::DataTypeImpl.

Definition at line 889 of file data_types.h.


The documentation for this class was generated from the following file: