-
Notifications
You must be signed in to change notification settings - Fork 27.4k
RNG for torch.randn_like #27072
Copy link
Copy link
Closed
Labels
enhancementNot as big of a feature, but technically not a bug. Should be easy to fixNot as big of a feature, but technically not a bug. Should be easy to fixmodule: 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
I hope that torch.randn_like can take generator=RNG argument as other random generation functions.
init_params = [torch.randn_like(param.data, generator=rng) for param in nn.parameters()]I know that the equivalence
init_params = [torch.randn(param.size(), generator=rng).to(param.data) for param in nn.parameters()]can work.
But for consistency, I still hope that all random related functions can take generator as an argument.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNot as big of a feature, but technically not a bug. Should be easy to fixNot as big of a feature, but technically not a bug. Should be easy to fixmodule: 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