I need to sample positive and negative integers from the uniform distribution using only Pytorch functions.
I am using the function  :
random_(from=0, to=None, *, generator=None)
For example :
torch.Tensor(10).random_(2,5) : produces a tensor of length 10 with integers sampled from 2 to 5
torch.Tensor(10).random_(0,5) : produces a tensor of length 10 with integers sampled from 0 to 5
torch.Tensor(10).random_(-5,5) : produces a tensor of length 10 with integers …
The last case is problematic. I get ENORMOUS values as output.
Why?
I should emphasize that I prefer using only Pytorch function only.