From 1cb5aa6c6039038095f3a505d7f3bdb5a2d6a1d4 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Fri, 11 Dec 2020 12:36:15 -0800 Subject: [PATCH] Fix structured kernel codegen (#49244) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/49244 see https://fb.quip.com/ceEdANd5iVsO RegisterMkldnnCPU kernels incorrectly used makeUnboxedOnly() calls to register add_.Tensor kernels. This is because the codegen incorrectly thought they're not c10-full. This PR fixes that. ghstack-source-id: 118411117 Test Plan: After this PR, RegisterMkldnnCPU doesn't contain the makeUnboxedOnly() calls anymore. Reviewed By: ezyang Differential Revision: D25500246 fbshipit-source-id: 8a8c2be9c4f4a5ce7eaae94257c2f8cbd176e92e --- tools/codegen/gen.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/codegen/gen.py b/tools/codegen/gen.py index af3ebbf674f4..8c22c1fe702c 100644 --- a/tools/codegen/gen.py +++ b/tools/codegen/gen.py @@ -471,6 +471,7 @@ def gen_one(f: NativeFunction) -> Optional[str]: return list(mapMaybe(gen_one, g.functions())) + @method_with_native_function def gen_unstructured(self, f: NativeFunction) -> Optional[str]: # for mypy type refinement; would be fixed by TODO on target assert self.target is not Target.DECLARATION