Solved by tom in post #2 
              
              
                I agree with your that torch.tensor(5.) would seem to be even better here for what you’re trying to achieve. 

It seems most concise.
The tensor will be truly a scalar (0-dim) tensor (you’d need to do torch.ones(())) for that.
There isn’t any performance aspect. (e.g. when you’re in the middle of a …