Hi, Thanks for help.
I made a small change in order to observe the change in value. The code and output results are shown below.
std::cout << x << std::endl;  // print normalized input data

x = fc1->forward(x);
std::cout << x << std::endl;

x = torch::leaky_relu(x);
std::cout << x << std::endl;

x = fc2->forward(x);
std::cout << x << std::endl;


202109301724401058×1001 69 KB

I built the same network on PyTorch, but his output was normal, with no large or small values. It is worth mentioning that in LibTorch, I initialized the network to Double type by using code below, maybe this is a problem?
model->to(device, torch::kDouble);

Looking forward to your reply, Thanks!