maybe it is a bug
问题描述 Please describe your issue
https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/infermeta/binary.cc
At line 1719, in the function "SigmoidCrossEntropyWithLogitsInferMeta", the original code is
if (check) {
PADDLE_ENFORCE_EQ(
phi::slice_ddim(x_dims, 0, rank),
phi::slice_ddim(labels_dims, 0, rank),
phi::errors::InvalidArgument(
"Input(X) and Input(Label) shall have the same shape "
"except the last dimension. But received: the shape of "
"Input(X) is [%s], the shape of Input(Label) is [%s].",
x_dims,
labels_dims));
}
maybe the "rank" should be changed to "rank - 1"
您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档、常见问题、历史Issue、AI社区来寻求解答。祝您生活愉快~
Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the API,FAQ,Github Issue and AI community to get the answer.Have a nice day!
I found it in the documentation https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/dev_guides/api_contributing_guides/new_cpp_op_cn.html . It is a bug in my understanding. If it is not, just ignore my issues.
The location is at : 参考代码
(1) 判断的实现方法可以参考 SigmoidCrossEntropyWithLogitsInferMeta,SigmoidCrossEntropyWithLogits 要求X和labels的两个输入,除了最后一维以外,其他的维度完全一致