I have a similar problem with a fully convolutional network for image segmentation. Python results are as expected but libtorch c++ frontend predictions differ a lot. Did you find a solution for this problem?