Thanks for the answer. The background is simple. I am using Python Tensorflow to create and train my model. Got amazing results! The application I’m using needs a significant speed boost, so I decided to rewrite everything in C++. It seemed to me that the most suitable and friendly C ++ API in LibTorch, so I rewrote everything for LibTorch. I did it for the first time, but I studied a lot of information on the Internet. So I can assume that I’m doing everything right. Just checked the experiment, trained the Python TF model and C ++ LibTorch on the same dataset, TF excellent results, Torch does not work, as if the network had not been trained, and it works on the training set. I do not understand what’s the matter. It is unlikely that the matter is in the functions used, because it would not work in TF either, where there is a fundamental error associated with the Torch feature. Can I provide the model description code here? Maybe it’s a matter of data transfer, perhaps somewhere that happens with the type or something like that.