mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
C++ API parity: AdaptiveAvgPool2d
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/26818 Test Plan: Imported from OSS Differential Revision: D17627822 Pulled By: pbelevich fbshipit-source-id: 0e1dea1c3ff2650dbc7902ce704ac6b47588d0bb
This commit is contained in:
committed by
Facebook Github Bot
parent
7d58060f49
commit
a31fd5ea68
@@ -115,3 +115,12 @@ TEST_F(FunctionalTest, AdaptiveAvgPool1d) {
|
||||
ASSERT_TRUE(torch::allclose(y, torch::ones({1, 1, 3})));
|
||||
ASSERT_EQ(y.sizes(), torch::IntArrayRef({1, 1, 3}));
|
||||
}
|
||||
|
||||
TEST_F(FunctionalTest, AdaptiveAvgPool2d) {
|
||||
auto x = torch::ones({2, 5, 5});
|
||||
auto y = F::adaptive_avg_pool2d(x, AdaptiveAvgPool2dOptions(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