Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions syft/frameworks/torch/hook/hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,12 +444,6 @@ def _hook_torch_module(self):
the real :func:`torch.cat` will become :func:`torch.native_cat`
and :func:`torch.cat` will have our hooking code.
"""

if torch.__version__ < "1.0.2":
# Hard fix for PyTorch versions < 1.0.2
# usage of torch.jit requires a torch version < torch 1.1, so we still need to support this torch version
syft.torch.apply_fix16922(self.torch)

torch_modules = syft.torch.torch_modules

for module_name, torch_module in torch_modules.items():
Expand Down
18 changes: 0 additions & 18 deletions syft/frameworks/torch/torch_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,21 +158,3 @@ def is_inplace_method(self, method_name):
is_inplace = method_name[-1] == "_" and "__" not in method_name
self.inplace_methods[method_name] = is_inplace
return is_inplace

@staticmethod
def apply_fix16922(torch):
"""
Apply the fix made in PR16922 of PyTorch until people use PyTorch 1.0.2
:param torch: the pytorch module
"""
broken_funcs = [
"max_pool1d",
"max_pool2d",
"max_pool3d",
"adaptive_max_pool1d",
"adaptive_max_pool2d",
"adaptive_max_pool3d",
]
for broken_func in broken_funcs:
getattr(torch.nn.functional, broken_func).__module__ = "torch.nn.functional"
getattr(torch.nn.functional, broken_func).__name__ = broken_func