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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sphinx sometimes can not find the correct bool #43669

Closed
zasdfgbnm opened this issue Aug 26, 2020 · 4 comments
Closed

sphinx sometimes can not find the correct bool #43669

zasdfgbnm opened this issue Aug 26, 2020 · 4 comments
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

@zasdfgbnm
Copy link
Collaborator

zasdfgbnm commented Aug 26, 2020

I find this when working on #43667

If you replace the docs of torch.bmm

Args:
    input (Tensor): the first batch of matrices to be multiplied
    mat2 (Tensor): the second batch of matrices to be multiplied
    deterministic (bool, optional): flag to choose between a faster non-deterministic
                                    calculation, or a slower deterministic calculation.
                                    This argument is only available for sparse-dense CUDA bmm.
                                    Default: ``False``
    {out}

with

Args:
    input (Tensor): the first batch of matrices to be multiplied
    mat2 (Tensor): the second batch of matrices to be multiplied

Keyword args:
    deterministic (bool, optional): flag to choose between a faster non-deterministic
                                    calculation, or a slower deterministic calculation.
                                    This argument is only available for sparse-dense CUDA bmm.
                                    Default: ``False``
    {out}

you will get an error

docstring of torch.bmm:: WARNING: more than one target found for cross-reference 'bool': torch.FloatStorage.bool, torch.Tensor.bool

cc @jlin27 @mruberry

@zasdfgbnm zasdfgbnm added the module: docs Related to our documentation, both in docs/ and docblocks label Aug 26, 2020
@mruberry
Copy link
Collaborator

@mattip Any idea for how we can resolve this? It's pretty easy to be hit by.

@mruberry mruberry added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Aug 26, 2020
@mattip
Copy link
Collaborator

mattip commented Aug 28, 2020

Not sure. I think somehow this is triggered by the automethod/autoclass directives in storage.rst and tensors.rst, (why does github make linking to a line in an rst file so hard) but in both cases bool() is a method, not an instance. I think putting it in double back-ticks might be a work around:

``bool``

@zasdfgbnm
Copy link
Collaborator Author

zasdfgbnm commented Aug 30, 2020

``bool``

does not produce link

image

vs

image

@mattip
Copy link
Collaborator

mattip commented Aug 30, 2020

I think it is OK that bool is not a link.

xuzhao9 pushed a commit that referenced this issue Sep 18, 2020
Summary:
Fixes #43669

The bool will still link to https://docs.python.org/3/library/functions.html#bool.
Tested using bmm:
![image](https://user-images.githubusercontent.com/16063114/93156438-2ad11080-f6d6-11ea-9b81-96e02ee68d90.png)

Pull Request resolved: #44686

Reviewed By: ngimel

Differential Revision: D23703823

Pulled By: mruberry

fbshipit-source-id: 7286afad084f5ab24a1254ad84e5d01907781c85
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.

3 participants