Skip to content

[0-size Tensor No.270] Add 0-size Tensor support for take - #73186

Merged
luotao1 merged 3 commits into
PaddlePaddle:developfrom
co63oc:e6
Jun 11, 2025
Merged

luotao1 merged 3 commits into
PaddlePaddle:developfrom
co63oc:e6

Conversation

@co63oc

@co63oc co63oc commented Jun 9, 2025 •

Copy link
Copy Markdown
Contributor

PR Category

Execute Infrastructure

PR Types

Improvements

Description

paddle.take 调用index_select
修改index_select infermeta检查
IndexSelectOpInferSymbolicShape 没有对应代码

math.py max_index 需要判断大于0
image

修改kernel为 index_select

PaddleAPITest 测试通过
image
high < 0 是PaddleAPITest中randint 调用时,high为0,如果输入为0-size,但是index不为0-size产生,torch 中同样会有错误

import torch
torch.take(torch.randn([3,0]), torch.randn([2, 3]).type(torch.int64))

image

@co63oc co63oc changed the title CI测试不review paddle.take [0-size Tensor No.270] Add 0-size Tensor support for take Jun 9, 2025
@codecov-commenter

codecov-commenter commented Jun 9, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@fa0f36f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
paddle/phi/kernels/cpu/index_select_grad_kernel.cc 0.00% 3 Missing ⚠️
paddle/phi/kernels/cpu/index_select_kernel.cc 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop   #73186   +/-   ##
==========================================
  Coverage           ?   25.00%           
==========================================
  Files              ?        3           
  Lines              ?        8           
  Branches           ?        0           
==========================================
  Hits               ?        2           
  Misses             ?        6           
  Partials           ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Jun 9, 2025
@paddle-bot paddle-bot Bot added the contributor External developers label Jun 9, 2025

@DanielSun11 DanielSun11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@luotao1
luotao1 merged commit 200c28d into PaddlePaddle:develop Jun 11, 2025
shanjiang7 pushed a commit to shanjiang7/Paddle that referenced this pull request Jun 12, 2025
@co63oc
co63oc deleted the e6 branch June 24, 2025 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants