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:
Pavel Belevich
2019-09-27 12:39:00 -07:00
committed by Facebook Github Bot
parent 3ad1bbe16a
commit bb7a415bcc
7 changed files with 172 additions and 0 deletions
+9
View File
@@ -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}));
}