TMVA::SOFIE Operator type Constant

Dear all,
I’m having trouble importing a model using TMVA::SOFIE.
The model was been trained with pytorch and I exported it to onnx following the recommendations found in the examples/forum.
However when I try to parse it with SOFIE I get the error below [1]
I’m using a standard LCG view (similar to the current default in swan) [2]
I put the original torch and onnx files here, if needed [3].
Any help is appreciated,
thanks a lot,
Pedro


[1]

Fill RModel with operators...
	0  0 parsing operator Constant
Parsing an operator Constant
Traceback (most recent call last):
  File "/eos/home-p/psilva/SWAN_projects/sdanalysis/notebooks/trainPzRegression.py", line 59, in <module>
    main()
  File "/eos/home-p/psilva/SWAN_projects/sdanalysis/notebooks/trainPzRegression.py", line 47, in main
    onnx2sofie(onnxfile)
  File "/eos/home-p/psilva/SWAN_projects/sdanalysis/notebooks/trainPzRegression.py", line 23, in onnx2sofie
    model=parser.Parse(onnxfile,True)
cppyy.gbl.std.runtime_error: TMVA::Experimental::SOFIE::RModel TMVA::Experimental::SOFIE::RModelParser_ONNX::Parse(string filename, bool verbose = false) =>
    runtime_error: TMVA::SOFIE Operator type Constant is not yet supported

[2] /cvmfs/sft.cern.ch/lcg/views/LCG_105_cuda/x86_64-el9-gcc11-opt/setup.sh

[3] /afs/cern.ch/user/p/psilva/public/torch_model/semiparametric_model_default.torch

Dear Pedro,

I am sorry to read you are experiencing this problem.
The error seems to be quite clear, but I add in the loop @moneta in case he can help out.

Best,
Danilo

Dear Pedro,

The operator 'Constant` is not currently support. It is however a trivial operator and we are going to add it soon. I will let you know when is included so you can try it using the nightly build of ROOT.
I am sorry for this trouble

Best regards,

Lorenzo

Dear Lorenzo (and Danilo)
many thanks, it’s very much appreciated.
Cheers,
Pedro

Dear Pedro,

I have created a PR, which now fixes the problems found parsing your model.
root-project/root#15837
I have tested with your model and it works.
I will let you know when is merged

Lorenzo

Dear Lorenzo,
many thanks - it’s very much appreciated
Looking forward for the integration
Cheers,
Pedro

Dear Lorenzo,
any chance it got integrated? I would be eager to test it
thanks a lot,
Pedro

Dear Pedro,
Sorry for the delay. I’ll ping the reviewer to approve the PR, so it will be integrated. I will let you know
Lorenzo

The Constant operator is now available and the nightly builds should be able to parse the model you posted. See Nightlies - ROOT to use the nightly version

If you have still issues, please let me know

Best regards

Lorenzo