oh, ok, I see what I did wrong. I had torch::Tensor(1.23) not torch::tensor(1.23). This is a bit confusing. I guess I got this from python, because in python it was possible to write FloatTensor(1.23).
Thank you