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

调研和排查当前 API 文档中需要改善的接口 #447

Open
doombeaker opened this issue Mar 17, 2022 · 13 comments
Open

调研和排查当前 API 文档中需要改善的接口 #447

doombeaker opened this issue Mar 17, 2022 · 13 comments
Assignees

Comments

@doombeaker
Copy link
Collaborator

doombeaker commented Mar 17, 2022

在 API 文档 https://oneflow.readthedocs.io/en/master/ 中,因为历史遗留问题,存在一些低级的问题。

主要有以下几类问题:

导出了 API,但是没有文档

如:https://oneflow.readthedocs.io/en/master/module.html#oneflow.nn.Module.apply

image

导出了 API,但是函数原型是空的,并且不正确

如:https://oneflow.readthedocs.io/en/master/oneflow.html#oneflow.tensor

image

这个 tensor 方法,显然有多个参数,原型并不是 tensor()

解决方法

这类问题常常是因为,直接从 C 导出的接口,文档编译生成系统无法提取到正确的函数原型。因此其实要在 docstring 中的第一行显式写出。

像这样:https://github.com/Oneflow-Inc/oneflow/blob/master/python/oneflow/framework/docstr/array_ops.py#L369

公式格式问题

如:https://oneflow.readthedocs.io/en/master/functional.html#oneflow.nn.functional.hardsigmoid

image

这类问题是往往是错误使用了 latex 语法。

解决办法就是参考其它显示正确的 docstring,进行修改,编译,知道调整正确后再提交。

任务

需要遍历 https://oneflow.readthedocs.io/en/master/ 中的所有 API,找出有问题的 API,整理成表。方便后续找相应开发解决。

表格

API 问题 API作者 谁解决 PR
nn.Module 缺 docstring
oneflow.tensor 原型错误
@rainyq69

This comment was marked as resolved.

@rainyq69

This comment was marked as duplicate.

@rainyq69

This comment was marked as duplicate.

@robin978

This comment was marked as duplicate.

@rainyq69

This comment was marked as duplicate.

@robin978

This comment was marked as duplicate.

@robin978

This comment was marked as duplicate.

@rainyq69

This comment was marked as duplicate.

@rainyq69

This comment was marked as duplicate.

@robin978

This comment was marked as duplicate.

@doombeaker
Copy link
Collaborator Author

doombeaker commented Mar 18, 2022

API 缺文档问题分工

张晓雨

这一类 tensor 方法,大部分只要写 "See xxx" 就可以了。比如:https://oneflow.readthedocs.io/en/master/tensor.html#oneflow.Tensor.add

李响

王迎港

韩彬彬

赵露阳

郑泽康

张文骁

郭冉

许啸宇

张逸清

以下 reset_parametes 不应该导出,其实是需要修改 sphinx 配置。

@rainyq69
Copy link
Contributor

rainyq69 commented Mar 18, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants