Thank you for the answer. I am not working with a dataset, therefore I do not need to use transforms(), like you have stated. The input to the network is a one channel 16bit signed image. I changed my code to normalize the image like this:

input_img.convertTo(input_img, CV_32FC1);
input_img = (input_img - mean) / stddev;
std::vector<torch::jit::IValue> inputs;
inputs.push_back(torch::from_blob(input_img.data, { 1, 1, input_img.rows, input_img.cols }));

I guess it does not matter if I normalize before or after placing the image into the tensor, please tell me if I’m wrong.