How to Develop Dynamic Input Operators

A dynamic input operator indicates that the number of inputs is dynamic. For example, AddN indicates that N input tensors are accumulated to output one tensor, and the number of input tensors is not fixed. Dynamic input operators are developed in different ways in constructing and parsing input data: The input parameter of the kernel function uses the ListTensorDesc structure to store input data. Accordingly, the TensorList structure needs to be constructed to store parameter information during the call. The following describes the development processes based on the kernel launch and project-based operator development modes.

The following lists only code snippets. For details about a complete example, see dynamic input operator sample (project-based operator development) and dynamic input operator sample (kernel launch).