It’s not the same doing
import torch

a=torch.tensor(10) / torch.tensor(10).float()
b=torch.tensor([10]) / torch.tensor(10).float()
print(a, 'Dimensions: %s'%a.ndimension(),' Type %s'%a.type())
print(b,'Dimensions: %s'%b.ndimension(),' Type %s'%b.type())

/usr/bin/python3.6 /home/jfm/.PyCharm2019.1/config/scratches/scratch.py
tensor(1.) Dimensions: 0  Type torch.FloatTensor
tensor([1]) Dimensions: 1  Type torch.LongTensor

That’s why the result is different