template <
size_t ith_input,
size_t ith_output,
typename T,
typename... Ts> \
static
typename std::enable_if<std::is_same<T, Custom::Tensor<data_type>*>
::value, std::tuple<
T, Ts...>>::type \
CreateTuple(OrtKernelContext* context,
ArgPtrs&
args,
size_t num_input,
size_t num_output,
const std::string& ep) {
\
args.push_back(std::make_unique<Custom::Tensor<data_type>>(context, ith_output,
false)); \
std::tuple<T> current = std::tuple<T>{
reinterpret_cast<T>(args.back().get())}; \
auto next = CreateTuple<ith_input, ith_output + 1, Ts...>(context,
args, num_input, num_output, ep); \
return std::tuple_cat(current, next); \
} \
template <
size_t ith_input,
size_t ith_output,
typename T,
typename... Ts> \
static
typename std::enable_if<std::is_same<T, Custom::Tensor<data_type>&>
::value, std::tuple<
T, Ts...>>::type \
CreateTuple(OrtKernelContext* context,
ArgPtrs& args,
size_t num_input,
size_t num_output,
const std::string& ep) {
\
args.push_back(std::make_unique<Custom::Tensor<data_type>>(context, ith_output,
false)); \
std::tuple<T> current = std::tuple<T>{reinterpret_cast<T>(*args.back().get())}; \
auto next = CreateTuple<ith_input, ith_output + 1, Ts...>(context,
args, num_input, num_output, ep); \
return std::tuple_cat(current, next); \
} \
template <
size_t ith_input,
size_t ith_output,
typename T,
typename... Ts> \
static
typename std::enable_if<std::is_same<T, std::optional<Custom::Tensor<data_type>*>>
::value, std::tuple<
T, Ts...>>::type \
CreateTuple(OrtKernelContext* context,
ArgPtrs& args,
size_t num_input,
size_t num_output,
const std::string& ep) {
\
if (ith_output < num_output) {
\
args.push_back(std::make_unique<Custom::Tensor<data_type>>(context, ith_output,
false)); \
std::tuple<T> current = std::tuple<T>{reinterpret_cast<Custom::Tensor<data_type>*>(args.back().get())}; \
auto next = CreateTuple<ith_input, ith_output + 1, Ts...>(context,
args, num_input, num_output, ep); \
return std::tuple_cat(current, next); \
} else { \
std::tuple<T> current = std::tuple<T>{}; \
auto next = CreateTuple<ith_input, ith_output + 1, Ts...>(context,
args, num_input, num_output, ep); \
return std::tuple_cat(current, next); \
} \
}
GLsizei const GLchar *const * string
GLsizei const GLfloat * value
std::vector< ArgPtr > ArgPtrs
**If you just want to fire and args