Repository navigation
[0-size Tensor No.132、236、240、241、259] Add 0-size Tensor support for masked_select - #73180
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
|
CPU上测试都过了吗? |
已复测更新了描述 |
|
https://github.com/PFCCLab/PaddleAPITest/blame/main/report/0size_tensor_gpu/error_config.txt 中有paddle.masked_select的0-size 配置https://github.com/PFCCLab/PaddleAPITest/blob/main/report/0size_tensor_gpu/error_config_paddleonly.txt#L6571有 paddle.polar的0-size 配置,请验证一下 |
|
There was a problem hiding this comment.
下面这个算 0 size 问题吗,cpu 和 GPU 的梯度不一样了,torch 是[0,0].paddle 的cpu是对的
import paddle
import numpy as np
# paddle.device.set_device('cpu')
x = paddle.to_tensor([1,2], dtype='float32')
x.stop_gradient = False
y = paddle.to_tensor([False,False], dtype='bool')
z = x.masked_select(y)
print(z) #shape=[0]
z.sum().backward()
print(x.grad)
算是0-size问题。因为masked_select_grad的输入为0-size Tensor。PaddleAPITest可能还不支持masked_select_grad的检查,导致没测出异常。请 @co63oc 看一下 |
已修改kernel,增加单测 |
|
/re-run all-failed |




PR Category
Execute Infrastructure
PR Types
Improvements
Description
132 paddle.masked_select
236 paddle.nn.utils.parameters_to_vector
240 paddle.pdist
241 paddle.polar
259 paddle.sinc
增加单测
paddle.masked_select, paddle.polar 在 report/0size_tensor_gpu/test_history/20250528/accuracy/error_config.txt 中没有配置,应该是没有错误

paddle.nn.utils.parameter_to_vector 是PaddleAPITest错误,没有其他错误

paddle.pdist GPU/CPU测试都通过
paddle.sinc GPU/CPU测试都通过