Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions test/TensorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,20 @@ TEST_F(TensorTest, Transpose) {
EXPECT_EQ(transposed.sizes()[2], 2);
}

// 测试 defined
TEST_F(TensorTest, Defined) {
// Tensor tensor(paddle_tensor_);
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

EXPECT_TRUE(tensor.defined());
}

// 测试 reset
TEST_F(TensorTest, Reset) {
// Tensor tensor(paddle_tensor_);
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

tensor.reset();
EXPECT_FALSE(tensor.defined());
}

} // namespace test
} // namespace at