add test for defined and reset methods in TensorTest#9
add test for defined and reset methods in TensorTest#9youge325 wants to merge 3 commits intoPFCCLab:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds test coverage for two tensor lifecycle methods: defined() and reset(). These tests verify that tensors can be checked for initialization state and can be properly reset to an undefined state.
- Adds
Definedtest to verify that a properly initialized tensor returns true fordefined() - Adds
Resettest to verify that callingreset()makes a tensor undefined
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
test/TensorTest.cpp
Outdated
|
|
||
| // 测试 defined | ||
| TEST_F(TensorTest, Defined) { | ||
| // Tensor tensor(paddle_tensor_); |
There was a problem hiding this comment.
This commented-out code should be removed. The tensor object is already initialized in the test fixture's SetUp() method and is available to all test cases. This commented line appears to be leftover from development and is consistent with similar commented lines in other tests in this file that should also be cleaned up.
test/TensorTest.cpp
Outdated
|
|
||
| // 测试 reset | ||
| TEST_F(TensorTest, Reset) { | ||
| // Tensor tensor(paddle_tensor_); |
There was a problem hiding this comment.
This commented-out code should be removed. The tensor object is already initialized in the test fixture's SetUp() method and is available to all test cases. This commented line appears to be leftover from development and is consistent with similar commented lines in other tests in this file that should also be cleaned up.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
新增

reset和defined测试Paddle中SymInt是int64_t的别名,libtorch中SymInt是一个类,是否需要对齐一下SymInt,还是说以后的测试用例分别编译,只要输出相同就行