From d18ae6784416cc022f496769dde703a78dbcc2aa Mon Sep 17 00:00:00 2001 From: Yang Gu Date: Fri, 7 Aug 2020 18:47:10 +0800 Subject: [PATCH 1/2] Recover the attributes of torch in memory_format_tutorial --- intermediate_source/memory_format_tutorial.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/intermediate_source/memory_format_tutorial.py b/intermediate_source/memory_format_tutorial.py index 244e23ac204..014f1668504 100644 --- a/intermediate_source/memory_format_tutorial.py +++ b/intermediate_source/memory_format_tutorial.py @@ -261,14 +261,17 @@ def check_cl(*args, **kwargs): return result return check_cl +old_attrs = dict() def attribute(m): + old_attrs[m] = dict() for i in dir(m): e = getattr(m, i) exclude_functions = ['is_cuda', 'has_names', 'numel', 'stride', 'Tensor', 'is_contiguous', '__class__'] if i not in exclude_functions and not i.startswith('_') and '__call__' in dir(e): try: + old_attrs[m][i] = e setattr(m, i, check_wrapper(e)) except Exception as e: print(i) @@ -286,6 +289,13 @@ def attribute(m): # guide https://github.com/pytorch/pytorch/wiki/Writing-memory-format-aware-operators. # +###################################################################### +# Code below is to recover the attributes of torch. + +for (m, attrs) in old_attrs.items(): + for (k,v) in attrs.items(): + setattr(m, k, v) + ###################################################################### # Work to do # ---------- From 24bb11e835d008ec09c21eaa89434926452a33d3 Mon Sep 17 00:00:00 2001 From: Yang Gu Date: Fri, 7 Aug 2020 18:52:12 +0800 Subject: [PATCH 2/2] enable windows test --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5697f123d49..8c9c71c130e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -564,8 +564,4 @@ workflows: - master - pytorch_windows_build_worker: name: win_test_worker - filters: - branches: - only: - - master