Skip to content

show_doc rendering issues with TorchScript functions #1180

@warner-benjamin

Description

@warner-benjamin

show_doc currently has rendering issues with TorchScript functions.

import torch
from nbdev.showdoc import *

@torch.jit.script
def test(p:torch.Tensor):
    "Test torchscript function"
    return p

show_doc(test)

results in the following output, without a source link in the documentation

## ScriptFunction object at 0x7fc550c680e0>
Test torchscript function

switching to show_doc(test.name), where name is a torchscript function property, displays the method name and github source code link, but not the docstring:

## test
test

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions