Thank you very much for your reply @peterjc123 !
1. Are you mixing the Debug and Release configuration?
No. I have separate libtorch for Debug and Release configuration. The loading model code snippet runs well, which I think there is no configuration error.
2. Have you copied all the DLLs in LibTorch to the location of your executable?
Yes, I have all the DLL files copied.

image695×449 10.8 KB

3. Have you moved the model to the desired device before calculation?
The model is training on the GPU.

And I convert all the tensor data to GPU before calling forward() function.

image850×662 31 KB

4.which version of libtorch are you using?
The libtorch version is the latest 1.4. And I use pyTorch 1.4 for training the network.
My forward() function in python code returns as shown below:

Is this the proper way to return multiple values? Does this work in the JIT tracing for the C++ library?