

def test_call_cudnn_backrward(self):
    y = self.forward()
    y.grad = self.gy
    with mock.patch('cupy.cudnn.cudnn.poolingBackward') as func:
        y.backward()
        self.assertEqual(func.called, self.use_cudnn)

dataset/ETHPy150Open pfnet/chainer/tests/chainer_tests/functions_tests/pooling_tests/test_spatial_pyramid_pooling_2d.py TestMaxPooling2DCudnnCall.test_call_cudnn_backrward/original