From 9034b66f14096d39eb1a2bb8e273f4b78f93e58d Mon Sep 17 00:00:00 2001 From: Lu Fang Date: Thu, 18 Apr 2019 23:31:32 -0700 Subject: [PATCH] skip test_trace_c10_ops if _caffe2 is not built (#19099) Summary: fix https://github.com/pytorch/pytorch/issues/18142 Pull Request resolved: https://github.com/pytorch/pytorch/pull/19099 Differential Revision: D15010452 Pulled By: houseroad fbshipit-source-id: 5bf158d7fce7bfde109d364a3a9c85b83761fffb --- test/test_jit.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test_jit.py b/test/test_jit.py index 67c7f49..b66a156 100644 --- a/test/test_jit.py +++ b/test/test_jit.py @@ -1772,6 +1772,11 @@ graph(%x : Tensor, FileCheck().check("mul").check("add").run(str(trace)) def test_trace_c10_ops(self): + try: + _ = torch.ops._caffe2.GenerateProposals + except RuntimeError: + self.skipTest("Skip the test since c2 ops are not registered.") + class MyModel(torch.nn.Module): def __init__(self): super(MyModel, self).__init__() -- 2.7.4