7 #ifndef SHARED_PROVIDER
14 namespace onnxruntime {
15 #if !defined(DISABLE_SPARSE_TENSORS)
32 Init(pData, type, deleter);
36 data_.reset(pData, deleter);
41 data_.reset(pData, deleter);
46 return data_ && type_;
51 ORT_ENFORCE(onnxruntime::DataTypeImpl::GetType<T>() == type_, onnxruntime::DataTypeImpl::GetType<T>(),
" != ", type_);
52 return *
static_cast<T*
>(data_.get());
58 ORT_ENFORCE(onnxruntime::DataTypeImpl::GetType<T>() == type_, onnxruntime::DataTypeImpl::GetType<T>(),
" != ", type_);
59 return static_cast<T*
>(data_.get());
79 std::shared_ptr<void> data_;
96 inline const onnxruntime::TensorSeq& OrtValue::Get<onnxruntime::TensorSeq>()
const {
98 return *
static_cast<onnxruntime::TensorSeq*
>(data_.get());
102 inline onnxruntime::TensorSeq* OrtValue::GetMutable<onnxruntime::TensorSeq>() {
104 return static_cast<onnxruntime::TensorSeq*
>(data_.get());
107 #if !defined(DISABLE_SPARSE_TENSORS)
onnxruntime::MLDataType Type() const
static const char * ToString(MLDataType type)
bool IsTensorSequenceType() const
Base class for MLDataType.
bool IsTensor() const noexcept
void Init(void *pData, onnxruntime::MLDataType type, const std::function< void(void *)> &deleter)
void Init(void *pData, onnxruntime::MLDataType type, onnxruntime::DeleteFunc deleter)
#define ORT_ENFORCE(condition,...)
bool IsTensorSequence() const noexcept
This class implements SparseTensor. This class holds sparse non-zero data (values) and sparse format ...
void(*)(void *) DeleteFunc
bool IsSparseTensor() const
bool IsTensorType() const
OrtValue(void *pData, onnxruntime::MLDataType type, onnxruntime::DeleteFunc deleter)
bool IsSparseTensorType() const