Skip to content

Commit

Permalink
Better documentation, remove IsInvalidType
Browse files Browse the repository at this point in the history
  • Loading branch information
xadupre committed Jul 5, 2023
1 parent 4f99fd5 commit feb398c
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 11 deletions.
4 changes: 0 additions & 4 deletions include/onnxruntime/core/framework/data_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ class DataTypeImpl {
return type_ == GeneralType::kNonTensor;
}

bool IsInvalidType() const {
return type_ == GeneralType::kInvalid;
}

bool IsPrimitiveDataType() const {
return type_ == GeneralType::kPrimitive;
}
Expand Down
4 changes: 0 additions & 4 deletions include/onnxruntime/core/framework/ort_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ struct OrtValue {
#endif
}

bool IsInvalid() const noexcept {
return (type_ != nullptr && type_->IsInvalidType());
}

onnxruntime::MLDataType Type() const {
return type_;
}
Expand Down
4 changes: 4 additions & 0 deletions include/onnxruntime/core/session/onnxruntime_cxx_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ static_assert(sizeof(BFloat16_t) == sizeof(uint16_t), "Sizes must match");
/** \brief float8e4m3fn (Float8 Floating Point) data type
* \details It is necessary for type dispatching to make use of C++ API
* The type is implicitly convertible to/from uint8_t.
* See https://onnx.ai/onnx/technical/float8.html for further details.
*/
struct Float8E4M3FN_t {
uint8_t value;
Expand All @@ -229,6 +230,7 @@ static_assert(sizeof(Float8E4M3FN_t) == sizeof(uint8_t), "Sizes must match");
/** \brief float8e4m3fnuz (Float8 Floating Point) data type
* \details It is necessary for type dispatching to make use of C++ API
* The type is implicitly convertible to/from uint8_t.
* See https://onnx.ai/onnx/technical/float8.html for further details.
*/
struct Float8E4M3FNUZ_t {
uint8_t value;
Expand All @@ -245,6 +247,7 @@ static_assert(sizeof(Float8E4M3FNUZ_t) == sizeof(uint8_t), "Sizes must match");
/** \brief float8e5m2 (Float8 Floating Point) data type
* \details It is necessary for type dispatching to make use of C++ API
* The type is implicitly convertible to/from uint8_t.
* See https://onnx.ai/onnx/technical/float8.html for further details.
*/
struct Float8E5M2_t {
uint8_t value;
Expand All @@ -261,6 +264,7 @@ static_assert(sizeof(Float8E5M2_t) == sizeof(uint8_t), "Sizes must match");
/** \brief float8e5m2fnuz (Float8 Floating Point) data type
* \details It is necessary for type dispatching to make use of C++ API
* The type is implicitly convertible to/from uint8_t.
* See https://onnx.ai/onnx/technical/float8.html for further details.
*/
struct Float8E5M2FNUZ_t {
uint8_t value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,6 @@ struct ProviderHost {
#if !defined(DISABLE_SPARSE_TENSORS)
virtual bool DataTypeImpl__IsSparseTensorType(const DataTypeImpl* p) = 0;
#endif
virtual bool DataTypeImpl__IsInvalidType(const DataTypeImpl* p) = 0;

virtual DeleteFunc DataTypeImpl__GetDeleteFunc(const DataTypeImpl* p) = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ class DataTypeImpl final {
#if !defined(DISABLE_SPARSE_TENSORS)
bool IsSparseTensorType() const { return g_host->DataTypeImpl__IsSparseTensorType(this); }
#endif
bool IsInvalidType() const { return g_host->DataTypeImpl__IsInvalidType(this); }

DeleteFunc GetDeleteFunc() const { return g_host->DataTypeImpl__GetDeleteFunc(this); }

Expand Down
1 change: 0 additions & 1 deletion onnxruntime/core/session/provider_bridge_ort.cc
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,6 @@ struct ProviderHostImpl : ProviderHost {
#if !defined(DISABLE_SPARSE_TENSORS)
bool DataTypeImpl__IsSparseTensorType(const DataTypeImpl* p) override { return p->IsSparseTensorType(); }
#endif
bool DataTypeImpl__IsInvalidType(const DataTypeImpl* p) override { return p->IsInvalidType(); }

DeleteFunc DataTypeImpl__GetDeleteFunc(const DataTypeImpl* p) override { return p->GetDeleteFunc(); }

Expand Down

0 comments on commit feb398c

Please sign in to comment.