-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[Typing][A-66,A-67] Add type annotations for tensor patched methods #65201
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][A-66,A-67] Add type annotations for tensor patched methods #65201
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -758,50 +797,13 @@ def get_device_dtype_from_tensor(other): | |||
) | |||
return self._to(device, dtype, blocking) | |||
|
|||
@property | |||
def grad(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
无用方法,EagerTensor 已经直接在 C++ 端定义
{"grad", |
这里应该是给老动态图的 VarBase patch 的,老动态图 VarBase 很久之前就退场了
item: ( | ||
None | ||
| bool | ||
| int | ||
| slice | ||
| tuple[None | bool | int | slice, ...] | ||
| list[Tensor | bool | int] | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这块是不是可以整个type alias
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改好了~
None | ||
| bool | ||
| int | ||
| slice | ||
| tuple[None | bool | int | slice, ...] | ||
| list[Tensor | bool | int] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还有这块
def __getitem__( | ||
self, | ||
item: TensorIndex, | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
返回值哩?
PR Category
User Experience
PR Types
Improvements
Description
为 Tensor patch 的方法添加类型提示
Related links
PCard-66972