Thanks for your suggestion, I checked the weight and bias of fc1. As shown below, none of them are 0, but their range of values is indeed very large. For this situation, I have some confusion and don’t know what to do next.

Snipaste_2021-09-30_20-03-261375×2050 308 KB

I save and load the model by using the following code.
Net model = Net(in_feature, out_feature);
// some train and test code
torch::save(model, model_path);  // model_path is like "xxx.pt"

// initialize new model
Net new_model = Net(in_feature, out_feature);
torch::load(new_model, model_path);
new_model->to(device, torch::kDouble);
// and predict...

Thank you very much and look forward to your reply!