From 26cf85c43c9138fec60084efbc9f36ef0b6f6e03 Mon Sep 17 00:00:00 2001 From: Bram Wasti Date: Wed, 11 Nov 2020 09:31:46 -0800 Subject: [PATCH] Support user defined classes as constants (#45556) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/45556 User defined classes can be used as constants. This is useful when freezing and removing the module from the graph. Differential Revision: D23994974 fbshipit-source-id: c7683c44ae9288db56444e32181583bc89d9ed93 --- torch_glow/src/TorchGlowBackend.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/torch_glow/src/TorchGlowBackend.cpp b/torch_glow/src/TorchGlowBackend.cpp index d93540cce1..0176048acd 100644 --- a/torch_glow/src/TorchGlowBackend.cpp +++ b/torch_glow/src/TorchGlowBackend.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -595,6 +596,7 @@ compileImpl(const torch::jit::Module &origModule, auto graph = method.graph(); EliminateDeadCode(graph); EliminateCommonSubexpression(graph); + ConstantPropagation(graph); ConstantPooling(graph); }