Skip to content

[DLPACK] Refine typehint for from_dlpack#68305

Merged
HydrogenSulfate merged 8 commits intoPaddlePaddle:developfrom
HydrogenSulfate:refine_dlpack_typehint
Sep 23, 2024
Merged

[DLPACK] Refine typehint for from_dlpack#68305
HydrogenSulfate merged 8 commits intoPaddlePaddle:developfrom
HydrogenSulfate:refine_dlpack_typehint

Conversation

@HydrogenSulfate
Copy link
Contributor

@HydrogenSulfate HydrogenSulfate commented Sep 19, 2024

PR Category

User Experience

PR Types

Docs

Description

Pcard-75624

完善from_dlpack的类型提示,以及规范docsting的格式,相关PR:#67927

@paddle-bot
Copy link

paddle-bot bot commented Sep 19, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@CLAassistant
Copy link

CLAassistant commented Sep 19, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

>>> y = torch.from_dlpack(paddle.utils.dlpack.to_dlpack(x))
>>> print(y.shape)
torch.Size([2, 4])
>>> # doctest: -SKIP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里要不要拆分成两段示例代码?看起来比较独立

拆分示例代码需要为每段添加 name(可以全局搜 :name: 参考)

然后中文文档需要分别引用两段代码,可参考

https://github.com/PaddlePaddle/docs/blob/3db4cd854485ca4b9c74dd3ed8364be25746a776/docs/api/paddle/diag_cn.rst?plain=1#L31-L39


Examples:
.. code-block:: python
:name: code-paddle_to_paddle
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

和其他的一样统一用中划线吧 😂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow 🐾

@HydrogenSulfate HydrogenSulfate merged commit 136cf7e into PaddlePaddle:develop Sep 23, 2024
@HydrogenSulfate HydrogenSulfate deleted the refine_dlpack_typehint branch September 23, 2024 11:20
@HydrogenSulfate HydrogenSulfate linked an issue Oct 20, 2024 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

关于from_dlpack

3 participants