Modification of ONNX graph

I have the following ONNX graph and current output is from d_predictions.
Since I am making plugin for CTCGreedyDecode, I can take output from CTCGreedyDecode plugin directly and d_predictions is not necessary.

Can that node removal be done in ONNX graph or in TensorRT ?
If possible, how should I do that?

Hi @edit_or,
Please refer to the below link for reference.

The sample mentioned in the link uses the ONNX GraphSurgeon (ONNX-GS) API to modify layers or subgraphs in the ONNX graph. For this network, we transform Group Normalization, upsample and pad layers to remove unnecessary nodes for inference with TensorRT.

Thanks!