So in principle, tracing (as in torch.jit.trace) should work in C++ as well as in Python, but I must admit I didn’t try. (And when I said, anomaly detection should work in C++, I felt the need to implement it just to not be handing out bad advice too often.)
Maybe the easiest is to create that Python model after all.
Best regards
Thomas