From 96980b1dcb4e20b558918cf3f7eb291983030c79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=A4=E5=AE=89=E5=8D=87?= Date: Thu, 24 Feb 2022 10:01:45 +0800 Subject: [PATCH] Patch custom ops to torch. --- torch_npu/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/torch_npu/__init__.py b/torch_npu/__init__.py index 288515bc46..7ef01dbd4a 100644 --- a/torch_npu/__init__.py +++ b/torch_npu/__init__.py @@ -36,6 +36,7 @@ for name in dir(torch_npu._C._VariableFunctions): continue globals()[name] = getattr(torch_npu._C._VariableFunctions, name) __all__.append(name) + setattr(torch, name, getattr(torch_npu._C._VariableFunctions, name)) all_monkey_patches = [ ["npu", torch_npu.npu], -- Gitee