mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
[C++ API] Added missing antialiasing path in interpolation C++ api (#84599)
Description: Following https://github.com/pytorch/pytorch/pull/69318#issuecomment-1238433540 adding missing bicubic path for anti-alias flag to C++ frontend. - https://github.com/pytorch/pytorch/pull/70930 - added tests in pytorch/test/cpp/api/functional.cpp Pull Request resolved: https://github.com/pytorch/pytorch/pull/84599 Approved by: https://github.com/kit1980, https://github.com/malfet
This commit is contained in:
committed by
PyTorch MergeBot
parent
2fbc0fab20
commit
d951165bd8
@@ -2252,6 +2252,20 @@ TEST_F(FunctionalTest, Interpolate) {
|
||||
auto output = F::interpolate(tensor, options);
|
||||
ASSERT_TRUE(output.allclose(expected));
|
||||
}
|
||||
{
|
||||
auto tensor = torch::rand({2, 3, 32, 32});
|
||||
std::vector<int64_t> osize = {8, 10};
|
||||
auto expected = at::native::_upsample_bicubic2d_aa(
|
||||
tensor, osize, false, torch::nullopt);
|
||||
|
||||
auto options = F::InterpolateFuncOptions()
|
||||
.size(osize)
|
||||
.mode(torch::kBicubic)
|
||||
.align_corners(false)
|
||||
.antialias(true);
|
||||
auto output = F::interpolate(tensor, options);
|
||||
ASSERT_TRUE(output.allclose(expected));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(FunctionalTest, Pad1) {
|
||||
|
||||
Reference in New Issue
Block a user