Solved by ptrblck in post #2 
              
              
                Based on your code snippet it seems you are looking for the int() operator, not init(). 
If that’s the case: the int() operation will return a tensor transformed to the int32 data type: 
x = torch.randn(10) * 10
print(x)
> tensor([  2.9199, -13.7902,  -0.3769, -11.2643,  -2.8111,  -0.7583,  -2.9747,…