New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alias to generate tensor with random uniform distribution. #67321
Comments
SGTM! |
I am new to the codebase and would like to work on this but I have some questions. |
from my point of view it seems correct. You can simply add 1�7(high - low) * torch.rand(*size) + low 1�7 to torch.random @anjali411 @albanD @yatendra1999 |
def uniform(low,high,size): this will work I guess. |
Is this issue still open? |
tf.random.Generator( |
I guess we are still waiting to see if the FR was accepted. |
alias to generate tensor with random uniform distribution.
Motivation
uniform distribution is one of the most commonly used distributions by users. currently generating tensor distributed uniformly can be done using tensor initializer (
torch.FloatTensor(*size).uniform_(low, high)
), or by definition:(high - low) * torch.rand(*size) + low
.Pitch
Adding the alias `torch.random.uniform(low, high, size) for initiating a uniformly distributed tensor.
Alternatives
described above.
cc @pbelevich
The text was updated successfully, but these errors were encountered: