Skip to content

Commit

Permalink
Support user defined classes as constants (#45556)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch/pytorch#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
  • Loading branch information
bwasti authored and facebook-github-bot committed Nov 11, 2020
1 parent 2f2beaf commit 26cf85c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions torch_glow/src/TorchGlowBackend.cpp
Expand Up @@ -15,6 +15,7 @@
#include <torch/csrc/jit/ir/node_hashing.h>
#include <torch/csrc/jit/passes/common_subexpression_elimination.h>
#include <torch/csrc/jit/passes/constant_pooling.h>
#include <torch/csrc/jit/passes/constant_propagation.h>
#include <torch/csrc/jit/passes/dead_code_elimination.h>
#include <torch/csrc/jit/passes/freeze_module.h>
#include <torch/csrc/jit/passes/inliner.h>
Expand Down Expand Up @@ -595,6 +596,7 @@ compileImpl(const torch::jit::Module &origModule,
auto graph = method.graph();
EliminateDeadCode(graph);
EliminateCommonSubexpression(graph);
ConstantPropagation(graph);
ConstantPooling(graph);
}

Expand Down

0 comments on commit 26cf85c

Please sign in to comment.