mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
C++ API parity: AdaptiveMaxPool2d
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/26772 Test Plan: Imported from OSS Differential Revision: D17627823 Pulled By: pbelevich fbshipit-source-id: 195f1edabbbbe245de3568beb0c7925eb347118a
This commit is contained in:
committed by
Facebook Github Bot
parent
3ad1bbe16a
commit
bb7a415bcc
@@ -88,3 +88,12 @@ TEST_F(FunctionalTest, AdaptiveMaxPool1d) {
|
||||
ASSERT_TRUE(torch::allclose(y, torch::ones({1, 1, 3})));
|
||||
ASSERT_EQ(y.sizes(), torch::IntArrayRef({1, 1, 3}));
|
||||
}
|
||||
|
||||
TEST_F(FunctionalTest, AdaptiveMaxPool2d) {
|
||||
auto x = torch::ones({2, 5, 5});
|
||||
auto y = F::adaptive_max_pool2d(x, AdaptiveMaxPool2dOptions(3));
|
||||
|
||||
ASSERT_EQ(y.ndimension(), 3);
|
||||
ASSERT_TRUE(torch::allclose(y, torch::ones({2, 3, 3})));
|
||||
ASSERT_EQ(y.sizes(), torch::IntArrayRef({2, 3, 3}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user