[0-size Tensor] Add 0-size Tensor support for paddle.multiply、paddle.__mul___ #72984
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Category
Execute Infrastructure
PR Types
Improvements
Description
存在的问题
问题1

遇到0-size Tensor时,y 反向梯度shape错误。原因是ElementwiseMulGrad -->GetGradXAndYOut -->SumRawKernel, 但是【SCU】【Paddle Tensor 第二期 API 支持 0-size TensorNo.26、50】paddle.linalg.vecdot 支持 0-size Tensor #70379 对SumRawKernel进行了修改,让SumRawKernel重新对out Tensor的shape进行了推导和resize,进而导致了输出的维度被错误的reduce掉一个维度。
问题2

y为0 size Tensor,x为非0 size Tensor,x 的梯度存在错误。应该全是0。
xpu kernel 前向报错
检查与修复
除了一些非法参数输入,其余均通过。
pcard-67164