I have followed the instruction of AddingCustomOp.md to add my CustomOp, but my CustomOp has dynamic input, which is the number and type of input is uncertained. It can have two or three input, and the type of input could be int or float.
I use the first scheme of AddingCustomOp.md, which is "Using the custom op API in the C/C++ APIs (onnxruntime_c_api.h)", but I run into problems quickly. This scheme doesn't seem to support dynamic input. Because the running process is this:
BUT I can only specify One type or count of input, just like the code below.
size_t GetInputTypeCount() const { return 2; };
ONNXTensorElementDataType GetInputType(size_t /*index*/) const { return ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT; };
size_t GetOutputTypeCount() const { return 1; };
ONNXTensorElementDataType GetOutputType(size_t /*index*/) const { return ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT; };
HOW can I support dynamic input of CustomOp by custom_op_library?
@lewisword Yeah, the current custom ops are fairly simple and don't support dynamic inputs. It would require a more complex API, and at a certain point it's better to just add the op using the internal interfaces to get every feature.
But nothing is impossible if this is what people want. It's just not possible currently.
@RyanUnderhill
I need to implement a new relu op (onnx does not have this op), which supports float16 and float32 inputs, but I found that it cannot be done through the onnxruntime C/C++ custom interface, because an error will be reported if the custom_op name is the same.

sincerely thanks.
I have the same requirement. When can this function be supported
I have the same problem, When can this function be added
nothing is impossible if this is what people want, a ha ha.
people do want this!
Need this feature +1
Need multiple input types,for example float or float16。
Please view SliceCustomOp as know-how.