Extending existing relay operator with additional side operations

Hello everyone, I want to discuss a solution for my master thesis problem. I try to extend each Conv2D operation with additional Relay operations to generate a checksum detect soft faults. This checksum result should be then directly propagated to the output. Now to my questions:

  1. Why does the IRModule has a Function vector instead of one function. Will this pertain any normal NN like Resnet-50 to have more than 1 function?
  2. I assume that I need to write something similar to the ExprRewriter Class for transformations. The difference is that I have to track also the high-level relay function to extend the output with a Tuple including the old output Tuple and another new output for each checksum bit. Additionally, I have to integrate the newly created Relay::Ops nodes into the background data structure for each IRModule.function(). Any recommendations or anything I missed? The transformation would look like this: