pinocchio:

If U is a random variable uniformly distributed on [0, 1], then (r1 - r2) * U + r2 is uniformly distributed on [r1, r2]. Thus, you just need: (r1 - r2) * torch.rand(a, b) + r2 Alternatively, you can simply use: torch.FloatTensor(a, b).uniform_(r1, r2)


ok! My first time doing this, hopefully this is the right way to do it:

  
      github.com/pytorch/pytorch
  
  
    



Issue: Implement torch.uniform 105


	
	opened by renesax14
	on 2019-08-11
	
	
	


🚀 Feature
sample uniform vectors
Motivation
Have a out of the box uniform samples
Pitch
x = torch.uniform(a,b)
code
def uniform(a,b):
'''
If U is a random variable uniformly distributed...