Thanks for your attention! I defined my network in CPU which is in both Python and C++.

torch::jit::script::Module module = torch::jit::load(model_path,torch::kCPU);
I still get nan output. So i agree that maybe input data type is wrong:
    test_data = torch.from_numpy(test_data)
    test_data = torch.tensor(test_data,dtype=torch.float32)

	torch::Tensor tImage = torch::from_blob(src1.data, { 240,240,1 }, torch::kF32);
	tImage = tImage.permute({ 2,0,1 });
	tImage = tImage.div(255);
	tImage = tImage.unsqueeze(0);

Annoyingly, nan output still occures.