Skip to content

Commit

Permalink
fix bulid
Browse files Browse the repository at this point in the history
  • Loading branch information
RandyShuai committed Sep 19, 2023
1 parent 585d47b commit 09a6309
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions include/onnxruntime/core/session/onnxruntime_lite_custom_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,9 @@ struct Variadic : public TensorBase {
return output;
}
const void* DataRaw() const override {
ORT_CXX_API_THROW("DataRaw() cannot be applied to Variadic", ORT_RUNTIME_EXCEPTION);
return nullptr;
}
size_t SizeInBytes() const override {
ORT_CXX_API_THROW("SizeInBytes() cannot be applied to Variadic", ORT_RUNTIME_EXCEPTION);
return 0;
}
size_t Size() const {
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/session/custom_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#if !defined(ORT_MINIMAL_BUILD)
static constexpr uint32_t min_ort_version_with_optional_io_support = 8;
static constexpr uint32_t min_ort_version_with_variadic_io_support = 14;
static constexpr uint32_t min_ort_version_with_compute_v2_support = 17;
#endif
static constexpr uint32_t min_ort_version_with_compute_v2_support = 17;

#if !defined(DISABLE_FLOAT8_TYPES)
#define SUPPORTED_TENSOR_TYPES DataTypeImpl::AllTensorTypesIRv9()
Expand Down
8 changes: 4 additions & 4 deletions onnxruntime/test/testdata/custom_op_library/cpu/cpu_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ using namespace Ort::Custom;
namespace Cpu {

Ort::Status KernelOne(const Ort::Custom::Tensor<float>& X,
const Ort::Custom::Tensor<float>& Y,
Ort::Custom::Tensor<float>& Z) {
if (X.NumberOfElement()!=Y.NumberOfElement()) {
const Ort::Custom::Tensor<float>& Y,
Ort::Custom::Tensor<float>& Z) {
if (X.NumberOfElement() != Y.NumberOfElement()) {
return Ort::Status("x and y has different number of elements", OrtErrorCode::ORT_INVALID_ARGUMENT);
}
auto x_shape = X.Shape();
Expand Down Expand Up @@ -167,7 +167,7 @@ void FilterFloat8(const Ort::Custom::Tensor<Ort::Float8E4M3FN_t>& floats_in,
#endif

// a sample custom op accepting variadic inputs, and generate variadic outputs by simply 1:1 copying.
template<typename T>
template <typename T>
Ort::Status CopyVariadic(const Ort::Custom::Variadic& inputs, Ort::Custom::Variadic& outputs) {
for (size_t ith_input = 0; ith_input < inputs.Size(); ++ith_input) {
const auto& input = inputs[ith_input];
Expand Down

0 comments on commit 09a6309

Please sign in to comment.