Skip to content

Functions with multiline signature not displayed properly in docs #38694

@ShawnZhong

Description

@ShawnZhong

📚 Documentation

Functions with multiline signature are not properly displayed in the online docs

Take randint as an example, the function signature takes two lines in the docstring.

pytorch/torch/_torch_docs.py

Lines 4667 to 4670 in 15da26f

add_docstr(torch.randint,
r"""
randint(low=0, high, size, \*, generator=None, out=None, \
dtype=None, layout=torch.strided, device=None, requires_grad=False) -> Tensor

But on the docs website https://pytorch.org/docs/master/generated/torch.randint.html, the second line is not recognized as part of the function signature.

image

A similar issue happens to the index page as well: the second column shows the first line of the signature, instead of the description.

image

cc @ezyang @zou3519

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: docsRelated to our documentation, both in docs/ and docblockstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions