Revert D26598115: [pytorch][PR] Update XNNPACK

Test Plan: revert-hammer

Differential Revision:
D26598115 (3721962c33)

Original commit changeset: d652bacdee10

fbshipit-source-id: 7e0128aa9b7691ecd323687da6f6054363b3174a
This commit is contained in:
Howard Huang
2021-02-23 10:24:16 -08:00
committed by Facebook GitHub Bot
parent 49b59e3472
commit 2680ff7759
3 changed files with 2 additions and 21 deletions

View File

@ -10,12 +10,6 @@ from torch.nn import functional as F
from torch._C import MobileOptimizerType
from torch.testing._internal.common_quantized import override_quantized_engine
try:
import torchvision
HAS_TORCHVISION = True
except ImportError:
HAS_TORCHVISION = False
FileCheck = torch._C.FileCheck
class TestOptimizer(TestCase):
@ -434,19 +428,6 @@ class TestOptimizer(TestCase):
m_optim_res = m_optim(data)
torch.testing.assert_allclose(m_res, m_optim_res, rtol=1e-2, atol=1e-3)
@unittest.skipUnless(HAS_TORCHVISION, "Needs torchvision")
def test_mobilenet_optimize_for_mobile(self):
m = torchvision.models.mobilenet_v3_small()
m = torch.jit.script(m)
m = optimize_for_mobile(m)
# run forward 3 times until segfault, see https://github.com/pytorch/pytorch/issues/52463
x = torch.zeros(1, 3, 56, 56)
self.assertEqual(m(x).numel(), 1000)
self.assertEqual(m(x).numel(), 1000)
self.assertEqual(m(x).numel(), 1000)
if __name__ == '__main__':
run_tests()