I have a pytorch model trained in python without ROOT. Now I wish to load the model in C++ using ROOT for event-by-event inference. The C++ ROOT version which I am going to use comes with the ATLAS analysis release and it does not support pytorch interface.
I wonder if I could convert the torchscript model to a .xml file so I can load it with RReader? Are there any code examples which convert a pretrained torchscript model to .xml files?
We don’t have a way to convert to a XML file yet, but we have a way to convert to a ROOT format or to create an header file that can be compiled and used for evaluation of the model using a new functionality introduced in the ROOT master.
The tutorial https://github.com/root-project/root/blob/master/tutorials/tmva/TMVA_SOFIE_PyTorch.C shows an example on how to convert the model.
If you have any questions or feedback in using this new feature, please let me know