-
Notifications
You must be signed in to change notification settings - Fork 5.7k
rename LoDTensor::Slice to Shrink #4343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rename LoDTensor::Slice to Shrink #4343
Conversation
@@ -56,19 +56,19 @@ TEST_F(LoDTensorTester, NumElements) { | |||
ASSERT_EQ(lod_tensor_.NumElements(2), 8UL); | |||
} | |||
|
|||
TEST_F(LoDTensorTester, SliceLevels) { | |||
TEST_F(LoDTensorTester, ShrinkLevels) { | |||
// slice 1 level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slice => shrink
// slice 1 level | ||
for (size_t level = 0; level < 3UL; ++level) { | ||
LoDTensor new_lod_tensor = lod_tensor_; | ||
new_lod_tensor.SliceLevels(level, level + 1); | ||
new_lod_tensor.ShrinkLevels(level, level + 1); | ||
ASSERT_EQ(new_lod_tensor.NumLevels(), 1UL); | ||
ASSERT_EQ(new_lod_tensor.NumElements(0), lod_tensor_.NumElements(level)); | ||
ASSERT_EQ(new_lod_tensor.data<float>(), lod_tensor_.data<float>()); | ||
} | ||
// slice 2 level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slice => shrink
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! but should change the two comment before merge
resolves: #4344