[Cpp API Compatibility] Add broadcast_to cross-framework test and update mapping doc#64
Open
youge325 wants to merge 9 commits into
Open
[Cpp API Compatibility] Add broadcast_to cross-framework test and update mapping doc#64youge325 wants to merge 9 commits into
youge325 wants to merge 9 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a cross-framework compatibility test for at::broadcast_to and reflects its newly-aligned status in the C++ API mapping documentation.
Changes:
- New test file
test/ATen/ops/BroadcastToTest.cppwith 11 GTest cases covering shape, dtype, exception, and function-form coverage, following the existingFileManergercreate/append output pattern. - Moves
at::broadcast_tofrom "功能缺失" to "API 完全一致" indoc/cpp_api_mapping_cn.mdand updates the corresponding summary counts (66→67 and 790→789).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/ATen/ops/BroadcastToTest.cpp | New compatibility test exercising Tensor::broadcast_to and at::broadcast_to across shapes/dtypes/exceptions, serialized to the shared /tmp/paddle_cpp_api_test/ result file. |
| doc/cpp_api_mapping_cn.md | Reclassifies at::broadcast_to as fully consistent and updates summary statistics; renumbering introduces a duplicate 22 in the consistent table and a 300 gap in the missing table. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
56
to
58
| | 21 | `at::broadcast_to` | `at::broadcast_to` (compat层) | API 完全一致 | - | | ||
| | 22 | `at::eye` | `at::eye` (compat层) | API 完全一致 | - | | ||
| | 22 | `at::flatten` | `at::flatten` (compat层) | API 完全一致 | - | |
Comment on lines
726
to
727
| | 299 | `at::bucketize` | - | 功能缺失 | - | | ||
| | 301 | `at::can_cast` | - | 功能缺失 | - | |
0d0c72c to
b7881c3
Compare
5b4b098 to
a62ee39
Compare
…ate mapping doc - Add test/ATen/ops/BroadcastToTest.cpp with 11 test cases - Shape coverage: small, large, boundary empty, boundary rank less - Dtype coverage: kFloat, kDouble, kInt, kLong - Exception coverage: invalid non-singleton, high rank to low rank - Function form: at::broadcast_to(t, size) - Update doc/cpp_api_mapping_cn.md: broadcast_to from 功能缺失 to API完全一致 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…d strides diff - Replace .contiguous() calls with strides-aware element access in BroadcastToTest.cpp, so strides differences between Paddle and PyTorch are preserved and detected by result_cmp. - Add strides field to result output for layout comparison. - Record the known mismatch (Paddle expand uses non-zero strides for broadcast dims vs PyTorch uses zero strides) in mismatch_api_record.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ate mapping doc - Add test/ATen/ops/BroadcastToTest.cpp with 11 test cases - Shape coverage: small, large, boundary empty, boundary rank less - Dtype coverage: kFloat, kDouble, kInt, kLong - Exception coverage: invalid non-singleton, high rank to low rank - Function form: at::broadcast_to(t, size) - Update doc/cpp_api_mapping_cn.md: broadcast_to from 功能缺失 to API完全一致 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ides diff - Replace .contiguous() with strides-aware element access in ExpandTest.cpp. - Add strides field to result output for layout comparison. - Record expand strides mismatch alongside broadcast_to in mismatch_api_record.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… and update mapping doc" This reverts commit d4aa08c.
- BroadcastToTest and ExpandTest now MATCH after compat layer fix - Document the fix in Paddle expand.h (as_strided with stride=0) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…expand - BroadcastToTest: add BroadcastToScalar (0-d tensor), BroadcastToNegativeOne - ExpandTest: add ExpandScalar (0-d tensor), ExpandNegativeOne (-1 support), ExpandNegativeOneLeadingError (-1 in leading dim throws) - Revert BroadcastToRejectsNegativeOne (PyTorch broadcast_to supports -1) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
a62ee39 to
16dbb98
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
New features
Description
Add cross-framework compatibility test for
at::broadcast_toand update API mapping documentation.New file:
test/ATen/ops/BroadcastToTest.cppat::broadcast_to(t, size)Modified:
doc/cpp_api_mapping_cn.mdat::broadcast_tofrom "功能缺失" (790) to "API 完全一致" (67)Related: PaddlePaddle/Paddle#79173
是否引起精度变化
否