Add custom operator for onnxruntime and fix paddle backend (#35)

Add custom operator for onnxruntime ans fix paddle backend
This commit is contained in:
Jason
2022-07-23 22:21:36 +08:00
committed by GitHub
parent 51ecb407d4
commit 4b681581b1
12 changed files with 666 additions and 60 deletions

View File

@@ -20,7 +20,7 @@
#include <vector>
#include "fastdeploy/backends/backend.h"
#include "onnxruntime_cxx_api.h" // NOLINT
#include "onnxruntime_cxx_api.h" // NOLINT
namespace fastdeploy {
@@ -68,6 +68,8 @@ class OrtBackend : public BaseBackend {
TensorInfo GetInputInfo(int index);
TensorInfo GetOutputInfo(int index);
static std::vector<OrtCustomOp*> custom_operators_;
void InitCustomOperators();
private:
Ort::Env env_;
@@ -76,9 +78,8 @@ class OrtBackend : public BaseBackend {
std::shared_ptr<Ort::IoBinding> binding_;
std::vector<OrtValueInfo> inputs_desc_;
std::vector<OrtValueInfo> outputs_desc_;
Ort::CustomOpDomain custom_op_domain_ = Ort::CustomOpDomain("Paddle");
OrtBackendOption option_;
void CopyToCpu(const Ort::Value& value, FDTensor* tensor);
};
} // namespace fastdeploy
} // namespace fastdeploy