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

[doc] Broken formatting for the function signature of torch.randperm #50207

Closed
kshitij12345 opened this issue Jan 7, 2021 · 4 comments
Closed
Labels
module: docs Related to our documentation, both in docs/ and docblocks triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@kshitij12345
Copy link
Collaborator

kshitij12345 commented Jan 7, 2021

馃摎 Documentation

Documentation does not mention anything about randperm accepting a generator.
https://pytorch.org/docs/stable/generated/torch.randperm.html

Following works:

>>> torch.randperm(10, generator=g)

Also,

- func: randperm(int n, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: randperm.generator(int n, *, Generator? generator, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: randperm.out(int n, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: randperm.generator_out(int n, *, Generator? generator, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU: randperm_out_cpu
CUDA: randperm_out_cuda

cc @jlin27 @mruberry

@zou3519 zou3519 added module: docs Related to our documentation, both in docs/ and docblocks triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Jan 7, 2021
@zou3519
Copy link
Contributor

zou3519 commented Jan 7, 2021

We would accept a PR to fix this (unless it turns out that there's a reason why this isn't documented)

@mruberry
Copy link
Collaborator

mruberry commented Jan 7, 2021

cc @ngimel - is there a better label or person to cc for this?

@ngimel
Copy link
Collaborator

ngimel commented Jan 7, 2021

cc @pbelevich, I don't think there's a reason for it to be undocumented. See also #44714 for some corner cases where generator argument is ignored causing segfaults.

@kshitij12345
Copy link
Collaborator Author

kshitij12345 commented Jan 8, 2021

It (documentation for generator arg) is fixed in #47231

Correct documentation is available on docs for master: https://pytorch.org/docs/master/generated/torch.randperm.html?highlight=torch%20randperm#torch.randperm

The formatting of the function signature looks to be broken,
Screenshot from 2021-01-08 10-03-54

@kshitij12345 kshitij12345 changed the title [doc] randperm: generator= argument is not documented [doc] Broken formatting for the function signature of torch.randperm Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: docs Related to our documentation, both in docs/ and docblocks triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants