-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Assign torch.Generator in APIs like torch.randn_like() #128786
Copy link
Copy link
Closed
Labels
actionablemodule: python frontendFor issues relating to PyTorch's Python frontendFor issues relating to PyTorch's Python frontendmodule: randomRelated to random number generation in PyTorch (rng generator)Related to random number generation in PyTorch (rng generator)triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
🚀 The feature, motivation and pitch
It is possible to add generator argument in APIs like torch.randn_like()?
Because torch.randn() has argument generator and at the same time, in my opinion, torch.randn_like(A, generator=rng_torch) should output the same result as torch.randn(A.shape, generator=rng_torch).
Alternatives
No response
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
actionablemodule: python frontendFor issues relating to PyTorch's Python frontendFor issues relating to PyTorch's Python frontendmodule: randomRelated to random number generation in PyTorch (rng generator)Related to random number generation in PyTorch (rng generator)triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module