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-60] Add type annotations for python/paddle/incubate/autograd/primapi.py #66016

Merged
merged 3 commits into from
Jul 14, 2024

Conversation

megemini
Copy link
Contributor

PR Category

User Experience

PR Types

Improvements

Description

类型标注:

  • python/paddle/incubate/autograd/primapi.py

Related links

@SigureMo @megemini

Copy link

paddle-bot bot commented Jul 13, 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.

from paddle import Tensor
from paddle.base.framework import Block

_T_TensorOrTensors = TypeVar("_T_TensorOrTensors", Tensor, Sequence[Tensor])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_T_TensorOrTensors = TypeVar("_T_TensorOrTensors", Tensor, Sequence[Tensor])
_TensorOrTensorsT = TypeVar("_TensorOrTensorsT", Tensor, Sequence[Tensor])

backward_length=-1,
):
blocks: Block | Sequence[Block],
blacklist: set | frozenset = frozenset(),
Copy link
Member

Choose a reason for hiding this comment

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

set 泛型参数漏了?frozenset 是不是也是泛型?

SigureMo
SigureMo previously approved these changes Jul 14, 2024
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
Copy link
Member

示例代码好像有问题?

@megemini
Copy link
Contributor Author

示例代码好像有问题?

是代码有问题

ad = primx.Transform(block)
xs_dot, ys_dot = ad.linearize(xs, ys)

primx.Transform 里面压根没有 linearize 方法 ... ...

都不用写测试用例的吗 ... ...

咋办?SKIP?

@SigureMo
Copy link
Member

SigureMo commented Jul 14, 2024

一年前 #56359 推 xdoctest 时候还是能跑通的

primx.Transform 里面压根没有 linearize 方法 ... ...

看了下,是 #63399 删的,单测估计也一并被删了

skip 吧,周一我和组合算子同学同步下这个问题

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 d2725ba into PaddlePaddle:develop Jul 14, 2024
30 of 32 checks passed
lixcli pushed a commit to lixcli/Paddle that referenced this pull request Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants