toch.rand returns a tensor samples uniformly in [0, 1). Scaling it as shown in your example should work.
Also, the second approach is fine.
If you would like to have a standalone torch.uniform method, I would recommend to create an issue in github and start the discussion there.