HDK
|
#include <onnxruntime_lite_custom_op.h>
Classes | |
struct | Kernel |
Public Types | |
template<typename... Args> | |
using | CustomComputeFn = void(CustomOp::*)(Args...) |
template<typename... Args> | |
using | CustomComputeFnReturnStatus = Status(CustomOp::*)(Args...) |
using | MyType = OrtLiteCustomStruct< CustomOp > |
![]() | |
using | ConstOptionalFloatTensor = std::optional< const Custom::Tensor< float > & > |
using | OptionalFloatTensor = std::optional< Custom::Tensor< float >> |
Public Member Functions | |
OrtLiteCustomStruct (const char *op_name, const char *execution_provider, int start_ver=1, int end_ver=MAX_CUSTOM_OP_END_VER) | |
SetShapeInfer (0) | |
template<typename... Args> | |
void | SetCompute (CustomComputeFn< Args...>) |
template<typename... Args> | |
void | SetCompute (CustomComputeFnReturnStatus< Args...>) |
template<typename C > | |
void | SetShapeInfer (...) |
Public Attributes | |
start_ver | |
end_ver | |
template<typename C > | |
decltype(&C::InferOutputShape) | SetShapeInfer (decltype(&C::InferOutputShape)) |
![]() | |
const std::string | op_name_ |
const std::string | execution_provider_ |
std::vector < ONNXTensorElementDataType > | input_types_ |
std::vector < ONNXTensorElementDataType > | output_types_ |
ShapeInferFn | shape_infer_fn_ = {} |
int | start_ver_ = 1 |
int | end_ver_ = MAX_CUSTOM_OP_END_VER |
void * | compute_fn_ = {} |
void * | compute_fn_return_status_ = {} |
Additional Inherited Members | |
![]() | |
template<size_t ith_input, size_t ith_output, typename... Ts> | |
static std::enable_if < sizeof...(Ts)==0, std::tuple <> >::type | CreateTuple (OrtKernelContext *, ArgPtrs &, size_t, size_t, const std::string &) |
template<size_t ith_input, size_t ith_output, typename T , typename... Ts> | |
static std::enable_if < std::is_same< T, OrtKernelContext * >::value, std::tuple< T, Ts...> >::type | CreateTuple (OrtKernelContext *context, ArgPtrs &args, size_t num_input, size_t num_output, const std::string &ep) |
template<size_t ith_input, size_t ith_output, typename T , typename... Ts> | |
static std::enable_if < std::is_same< T, OrtKernelContext & >::value, std::tuple< T, Ts...> >::type | CreateTuple (OrtKernelContext *context, ArgPtrs &args, size_t num_input, size_t num_output, const std::string &ep) |
template<size_t ith_input, size_t ith_output, typename T , typename... Ts> | |
static std::enable_if < std::is_same< T, const TensorArray * >::value, std::tuple< T, Ts...> >::type | CreateTuple (OrtKernelContext *context, ArgPtrs &args, size_t num_input, size_t num_output, const std::string &ep) |
template<size_t ith_input, size_t ith_output, typename T , typename... Ts> | |
static std::enable_if < std::is_same< T, const TensorArray & >::value, std::tuple< T, Ts...> >::type | CreateTuple (OrtKernelContext *context, ArgPtrs &args, size_t num_input, size_t num_output, const std::string &ep) |
template<size_t ith_input, size_t ith_output, typename T , typename... Ts> | |
static std::enable_if < std::is_same< T, TensorArray * > ::value, std::tuple< T, Ts...> >::type | CreateTuple (OrtKernelContext *context, ArgPtrs &args, size_t num_input, size_t num_output, const std::string &ep) |
template<size_t ith_input, size_t ith_output, typename T , typename... Ts> | |
static std::enable_if < std::is_same< T, TensorArray & > ::value, std::tuple< T, Ts...> >::type | CreateTuple (OrtKernelContext *context, ArgPtrs &args, size_t num_input, size_t num_output, const std::string &ep) |
template<typename... Ts> | |
static std::enable_if < 0==sizeof...(Ts)>::type | ParseArgs (std::vector< ONNXTensorElementDataType > &, std::vector< ONNXTensorElementDataType > &) |
![]() | |
template<typename T , typename... Ts> | |
static std::enable_if < 0<=sizeof...(Ts)&&std::is_same < T, OrtKernelContext * > ::value >::type ParseArgs(std::vector < ONNXTensorElementDataType > &input_types, std::vector < ONNXTensorElementDataType > &output_types){ParseArgs < Ts...>input_types, output_types);}template < typename T, typename...Ts > static typename std::enable_if< 0<=sizeof...(Ts)&&std::is_same < T, OrtKernelContext & > ::value >::type ParseArgs(std::vector < ONNXTensorElementDataType > &input_types, std::vector < ONNXTensorElementDataType > &output_types){ParseArgs < Ts...>input_types, output_types);}template < typename T, typename...Ts > static typename std::enable_if< 0<=sizeof...(Ts)&&std::is_same < T, const TensorArray & > ::value >::type ParseArgs(std::vector < ONNXTensorElementDataType > &input_types, std::vector < ONNXTensorElementDataType > &output_types){input_types.push_back(ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED);ParseArgs < Ts...>input_types, output_types);}template < typename T, typename...Ts > static typename std::enable_if< 0<=sizeof...(Ts)&&std::is_same < T, const TensorArray * > ::value >::type ParseArgs(std::vector < ONNXTensorElementDataType > &input_types, std::vector < ONNXTensorElementDataType > &output_types){input_types.push_back(ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED);ParseArgs < Ts...>input_types, output_types);}template < typename T, typename...Ts > static typename std::enable_if< 0<=sizeof...(Ts)&&std::is_same < T, TensorArray & >::value > ::type ParseArgs(std::vector < ONNXTensorElementDataType > &input_types, std::vector < ONNXTensorElementDataType > &output_types){output_types.push_back(ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED);ParseArgs < Ts...>input_types, output_types);}template < typename T, typename...Ts > static typename std::enable_if< 0<=sizeof...(Ts)&&std::is_same < T, TensorArray * >::value > ::type ParseArgs(std::vector < ONNXTensorElementDataType > &input_types, std::vector < ONNXTensorElementDataType > &output_types){output_types.push_back(ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED);ParseArgs < Ts...>input_types, output_types);}#define PARSE_INPUT_BASE(pack_type, onnx_type)#define PARSE_INPUT(data_type, onnx_type)#define PARSE_OUTPUT(data_type, onnx_type)#define PARSE_ARGS(data_type, onnx_type) PARSE_ARGS(std::string_view, ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING) OrtLiteCustomOp(const char *op_name, const char *execution_provider, ShapeInferFn shape_infer_fn, int start_ver=1, int end_ver=MAX_CUSTOM_OP_END_VER):op_name_(op_name), execution_provider_(execution_provider), shape_infer_fn_(shape_infer_fn), start_ver_(start_ver), end_ver_(end_ver){OrtCustomOp::version=ORT_API_VERSION;OrtCustomOp::GetName=[](const OrtCustomOp *op){return static_cast< const OrtLiteCustomOp * >op) -> op_name_.c_str();};OrtCustomOp::GetExecutionProviderType=[](const OrtCustomOp *op){return((OrtLiteCustomOp *) op) -> execution_provider_.c_str();};OrtCustomOp::GetInputMemoryType=[](const OrtCustomOp *, size_t){return OrtMemTypeDefault;};OrtCustomOp::GetInputTypeCount=[](const OrtCustomOp *op){auto self=reinterpret_cast < const OrtLiteCustomOp * >op);return self->input_types_.size();};OrtCustomOp::GetInputType=[](const OrtCustomOp *op, size_t indice){auto self=reinterpret_cast< const OrtLiteCustomOp * >op);return self->input_types_[indice];};OrtCustomOp::GetOutputTypeCount=[](const OrtCustomOp *op){auto self=reinterpret_cast < const OrtLiteCustomOp * >op);return self->output_types_.size();};OrtCustomOp::GetOutputType=[](const OrtCustomOp *op, size_t indice){auto self=reinterpret_cast< const OrtLiteCustomOp * >op);return self-> | output_types_ [indice] |
Definition at line 1004 of file onnxruntime_lite_custom_op.h.
using Ort::Custom::OrtLiteCustomStruct< CustomOp >::CustomComputeFn = void (CustomOp::*)(Args...) |
Definition at line 1006 of file onnxruntime_lite_custom_op.h.
using Ort::Custom::OrtLiteCustomStruct< CustomOp >::CustomComputeFnReturnStatus = Status (CustomOp::*)(Args...) |
Definition at line 1009 of file onnxruntime_lite_custom_op.h.
using Ort::Custom::OrtLiteCustomStruct< CustomOp >::MyType = OrtLiteCustomStruct<CustomOp> |
Definition at line 1011 of file onnxruntime_lite_custom_op.h.
|
inline |
Definition at line 1020 of file onnxruntime_lite_custom_op.h.
|
inline |
Definition at line 1044 of file onnxruntime_lite_custom_op.h.
|
inline |
Definition at line 1055 of file onnxruntime_lite_custom_op.h.
Ort::Custom::OrtLiteCustomStruct< CustomOp >::SetShapeInfer | ( | 0 | ) |
|
inline |
Definition at line 1075 of file onnxruntime_lite_custom_op.h.
Ort::Custom::OrtLiteCustomStruct< CustomOp >::end_ver |
Definition at line 1023 of file onnxruntime_lite_custom_op.h.
|
inline |
Definition at line 1066 of file onnxruntime_lite_custom_op.h.
Ort::Custom::OrtLiteCustomStruct< CustomOp >::start_ver |
Definition at line 1023 of file onnxruntime_lite_custom_op.h.