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

[Refine] Refine __cuda_array_interface__ #68227

Merged

Conversation

HydrogenSulfate
Copy link
Contributor

@HydrogenSulfate HydrogenSulfate commented Sep 14, 2024

PR Category

User Experience

PR Types

Not User Facing

Description

Pcard-75624

基于 #68192

  1. paddle.numel支持uint8和int8类型,并更新函数文档
  2. 使用Tensor.place.is_gpu_place,代替字符串匹配的方式,判断Tensor是否在GPU上
  3. 更新__cuda_array_interface的单测,使用 unitest 的assert代替 python 自带的assert

[pull] develop from PaddlePaddle:develop
[pull] develop from PaddlePaddle:develop
Copy link

paddle-bot bot commented Sep 14, 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.

@HydrogenSulfate HydrogenSulfate changed the title [Refine] Refine cuda array interface [Refine] Refine __cuda array interface__ Sep 14, 2024
@HydrogenSulfate HydrogenSulfate changed the title [Refine] Refine __cuda array interface__ [Refine] Refine __cuda_array_interface__ Sep 14, 2024
@@ -266,7 +266,7 @@ def numel(x: Tensor, name: str | None = None) -> Tensor:
Returns the number of elements for a tensor, which is a 0-D int64 Tensor with shape [].

Args:
x (Tensor): The input Tensor, it's data type can be bool, float16, float32, float64, int32, int64, complex64, complex128.
x (Tensor): The input Tensor, it's data type can be bool, float16, float32, float64, int8, int32, int64, complex64, complex128.
Copy link
Member

Choose a reason for hiding this comment

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

uint8 是不是也应该加一下?

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.

uint8 是不是也应该加一下?

  1. 已添加
  2. 嗯,正在更新一会儿附上链接

SigureMo
SigureMo previously approved these changes Sep 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 SigureMo merged commit f97db7a into PaddlePaddle:develop Sep 16, 2024
28 of 30 checks passed
@HydrogenSulfate HydrogenSulfate deleted the refine___cuda_array_interface__ branch September 16, 2024 18:13
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.

2 participants