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

[Typing][C-88,C-89] Add type annotations for python/paddle/incubate/operators/* #67104

Merged
merged 12 commits into from
Aug 10, 2024

Conversation

Sekiro-x
Copy link
Contributor

@Sekiro-x Sekiro-x commented Aug 6, 2024

PR Category

User Experience

PR Types

Improvements

Description

类型标注:

  • python/paddle/incubate/operators/
    graph_sample_neighbors.py
  • python/paddle/incubate/operators/
    graph_send_recv.py

Related links

@SigureMo @megemini

Copy link

paddle-bot bot commented Aug 6, 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.

return_eids: bool = False,
flag_perm_buffer: bool = False,
name: str | None = None,
) -> tuple[Tensor, Tensor, Tensor]:
Copy link
Contributor

Choose a reason for hiding this comment

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

根据 return_eids 使用 overload

Comment on lines 50 to 51
pool_type: str = "sum",
out_size=None,
Copy link
Contributor

Choose a reason for hiding this comment

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

pool_type 使用 Literal

out_size 没标注 ~

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
Contributor

Choose a reason for hiding this comment

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

overload 使用有问题,参考 #66792

@paddle-bot paddle-bot bot added the contributor External developers label Aug 6, 2024
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Aug 7, 2024
@megemini
Copy link
Contributor

megemini commented Aug 8, 2024

@Sekiro-x overload 的修改还有问题,而且跟我提到的那个 PR 中的错误几乎一样 ... ... 再仔细看一下,修改好了 @ 我 ~

@Sekiro-x
Copy link
Contributor Author

Sekiro-x commented Aug 8, 2024

@Sekiro-x overload 的修改还有问题,而且跟我提到的那个 PR 中的错误几乎一样 ... ... 再仔细看一下,修改好了 @ 我 ~

@megemini 这样吗

Comment on lines 29 to 34
@deprecated(
since="2.4.0",
update_to="paddle.geometric.sample_neighbors",
level=1,
reason="paddle.incubate.graph_sample_neighbors will be removed in future",
)
Copy link
Contributor

Choose a reason for hiding this comment

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

放到下面函数正式定义的地方吧, overload 的部分单独放在上面 ~

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
Contributor

Choose a reason for hiding this comment

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

看一下 CI 检查的情况,基本没问题了 ~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

只剩下PR-CI-Static-Check没有通过了

Copy link
Contributor

Choose a reason for hiding this comment

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

在示例的 graph_send_recv 调用处加上 type: ignore[operator] ,如

>>> out = paddle.incubate.graph_send_recv(x, src_index, dst_index, pool_type="sum") # type: ignore[operator]

看一下 CI 的报错信息,有多个地方需要加

Copy link
Contributor

@megemini megemini left a comment

Choose a reason for hiding this comment

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

LGTM ~

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 🐾

@SigureMo SigureMo merged commit f0cde33 into PaddlePaddle:develop Aug 10, 2024
31 checks passed
@Sekiro-x Sekiro-x deleted the sekiro branch August 10, 2024 04:42
Jeff114514 pushed a commit to Jeff114514/Paddle that referenced this pull request Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants