I have this simple example:
at::Tensor t0 = at::ones({ 3, 1, 64, 64 }, at::kFloat);
at::Tensor t1 = at::ones({ 3, 1, 64, 64 }, at::kFloat);
auto loss = torch::nn::functional::mse_loss(t0, t1);
Why am I getting for sizes_and_strides_.inlineStorage_ to be of the same size as t0 and t1? At the same time, numel_ reports 1.
I have also tried to manually specify the reduction to mean, but the result is the same.
If I do
auto manual_loss = (t0 - t1).pow(2).mean();
I got the inlineStorage_ = {0, 0, 0, 0, 0, 1, 0, 0, 0, 0} and numel_ also 1.
I have libtorch 2.9.0+cu128, using Visual Studio 2022