From 23f901a737c184be1432a37e7d2b37850bbed050 Mon Sep 17 00:00:00 2001 From: Zachary DeVito Date: Tue, 27 Nov 2018 19:11:47 -0800 Subject: [PATCH] fix enable_cpu_fuser Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/14440 Differential Revision: D13226354 Pulled By: zdevito fbshipit-source-id: e4ed023eece8b5b670a4a27d24a8688907b36b90 --- test/test_jit.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/test_jit.py b/test/test_jit.py index 6c81284..c66700b 100644 --- a/test/test_jit.py +++ b/test/test_jit.py @@ -207,9 +207,8 @@ def enable_cpu_fuser(fn): torch._C._jit_override_can_fuse_on_cpu(True) try: fn(*args, **kwargs) - except Exception: + finally: torch._C._jit_override_can_fuse_on_cpu(False) - raise return wrapper -- 2.7.4