add AvgPool2D backward pass on GPU (#68)

This commit is contained in:
Ryan Neph
2020-11-07 12:27:29 -08:00
committed by GitHub
parent ce6c408d78
commit 5265f6c578
2 changed files with 38 additions and 6 deletions

View File

@@ -97,7 +97,8 @@ class TestOps(unittest.TestCase):
lambda x: Tensor.max_pool2d(x, kernel_size=sz), gpu=self.gpu, forward_only=self.gpu)
def test_avgpool2x2(self):
helper_test_op([(32,2,111,28)], lambda x: torch.nn.functional.avg_pool2d(x, (2,2)), Tensor.avg_pool2d, gpu=self.gpu, forward_only=self.gpu)
# TODO Grad tolerance needs to be slightly relaxed; why?
helper_test_op([(32,2,111,28)], lambda x: torch.nn.functional.avg_pool2d(x, (2,2)), Tensor.avg_pool2d, gpu=self.gpu, grad_atol=1e-5)
if GPU:
class TestOpsGPU(TestOps):