Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

torch.randn signature is missing generator #97966

Open
albertz opened this issue Mar 30, 2023 · 1 comment
Open

torch.randn signature is missing generator #97966

albertz opened this issue Mar 30, 2023 · 1 comment
Labels
enhancement Not as big of a feature, but technically not a bug. Should be easy to fix module: docs Related to our documentation, both in docs/ and docblocks module: python frontend For issues relating to PyTorch's Python frontend module: random Related to random number generation in PyTorch (rng generator) triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@albertz
Copy link
Contributor

albertz commented Mar 30, 2023

馃摎 The doc issue

torch.randn lacks generator argument in the signature torch.randn(*size, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False, pin_memory=False).

Suggest a potential alternative/fix

Add generator, like in torch.rand:
torch.randn(*size, *, generator=None, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False, pin_memory=False)

cc @svekars @carljparker @pbelevich @albanD

@bdhirsh bdhirsh added triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module enhancement Not as big of a feature, but technically not a bug. Should be easy to fix module: random Related to random number generation in PyTorch (rng generator) module: python frontend For issues relating to PyTorch's Python frontend labels Mar 31, 2023
@albanD
Copy link
Collaborator

albanD commented Mar 31, 2023

Note that the overload does exist. So this is just a docs issue where the doc is not rendered properly like for the other random functions.

@albanD albanD added the module: docs Related to our documentation, both in docs/ and docblocks label Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Not as big of a feature, but technically not a bug. Should be easy to fix module: docs Related to our documentation, both in docs/ and docblocks module: python frontend For issues relating to PyTorch's Python frontend module: random Related to random number generation in PyTorch (rng generator) triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

3 participants