From: Lu Fang Date: Fri, 19 Apr 2019 06:31:32 +0000 (-0700) Subject: skip test_trace_c10_ops if _caffe2 is not built (#19099) X-Git-Tag: accepted/tizen/6.5/unified/20211028.231830~136 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9034b66f14096d39eb1a2bb8e273f4b78f93e58d;p=platform%2Fupstream%2Fpytorch.git 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 --- 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__()