Skip to content

Conversation

SigureMo
Copy link
Member

PR Category

User Experience

PR Types

Improvements

Description

为 Tensor patch 的方法添加类型提示

Related links

PCard-66972

Copy link

paddle-bot bot commented Jun 15, 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.

@@ -758,50 +797,13 @@ def get_device_dtype_from_tensor(other):
)
return self._to(device, dtype, blocking)

@property
def grad(self):
Copy link
Member Author

Choose a reason for hiding this comment

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

无用方法,EagerTensor 已经直接在 C++ 端定义

这里应该是给老动态图的 VarBase patch 的,老动态图 VarBase 很久之前就退场了

@SigureMo SigureMo requested a review from zrr1999 June 15, 2024 18:02
@PaddlePaddle PaddlePaddle locked and limited conversation to collaborators Jun 16, 2024
@PaddlePaddle PaddlePaddle unlocked this conversation Jun 16, 2024
zrr1999
zrr1999 previously approved these changes Jun 16, 2024
Comment on lines 991 to 998
item: (
None
| bool
| int
| slice
| tuple[None | bool | int | slice, ...]
| list[Tensor | bool | int]
),
Copy link
Member

Choose a reason for hiding this comment

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

这块是不是可以整个type alias

Copy link
Member Author

Choose a reason for hiding this comment

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

改好了~

Comment on lines 1006 to 1011
None
| bool
| int
| slice
| tuple[None | bool | int | slice, ...]
| list[Tensor | bool | int]
Copy link
Member

Choose a reason for hiding this comment

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

还有这块

@SigureMo SigureMo merged commit b29ab37 into PaddlePaddle:develop Jun 16, 2024
@SigureMo SigureMo deleted the typing/tensor-patch-methods branch June 16, 2024 16:32
def __getitem__(
self,
item: TensorIndex,
):
Copy link
Contributor

Choose a reason for hiding this comment

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

返回值哩?

@SigureMo SigureMo added HappyOpenSource 快乐开源活动issue与PR and removed HappyOpenSource 快乐开源活动issue与PR labels Jun 21, 2024
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.

3 participants