Skip to content

Commit

Permalink
Update node template
Browse files Browse the repository at this point in the history
  • Loading branch information
kraiskil committed Jul 28, 2024
1 parent 8d7e7ab commit 687d523
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/nodes/TEMPLATE
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ void TEMPLATE::parseAttributes( onnx::NodeProto &node )
/* Assign input tensors, resolve output tensor shapes, allocate output tensors */
void TEMPLATE::resolve(void)
{
Tensor *input_1 = inputs[0];
// Remember the parameters to the generated function,
// along with a descriptive name that is used locally in the generated source.
Tensor *input_1 = get_input_tensor(0);
// Name the parameters to the generated C function that implements this Node.
// The most "descriptive name" usually is the one this tensor has in the ONNX documentation.
register_input(input_1, "A");
// First one is typically named 'input', 'X', or 'A'
// In the onnx file the tensors have compilicated names that make sense only in the graph context.
name_input(0, "A");

if (inputs.size() == 2) {
Tensor *input_2_optional = inputs[1];
register_input(input_2_optional, "descriptive_name");
if (get_number_of_inputs() == 2) {
Tensor *input_2_optional = get_input_tensor(1);
name_input(1, "descriptive_name");
}
// else leave input_2_optional as null so other functions here know to ignore it


/* Create output tensors.
Expand Down

0 comments on commit 687d523

Please sign in to comment.