Skip to content

Commit 63aa688

Browse files
fix: add remove_exception pass from torch to fix uninitialized tensor… (#1345)
* fix: add remove_exception pass from torch to fix uninitialized tensor bug Signed-off-by: Bo Wang <[email protected]> * chore: apply linting Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Bo Wang <[email protected]> Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]> Co-authored-by: Naren Dasan <[email protected]>
1 parent 3ef7909 commit 63aa688

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/lowering/passes/exception_elimination.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "torch/csrc/jit/passes/dead_code_elimination.h"
55
#include "torch/csrc/jit/passes/guard_elimination.h"
66
#include "torch/csrc/jit/passes/peephole.h"
7+
#include "torch/csrc/jit/passes/remove_exceptions.h"
78
#include "torch/csrc/jit/runtime/graph_executor.h"
89

910
#include "core/util/prelude.h"
@@ -21,6 +22,7 @@ struct ExceptionOrPassPatternElimination {
2122

2223
void run() {
2324
findExceptionOrPassNodes(graph_->block());
25+
torch::jit::EliminateExceptions(graph_);
2426
torch::jit::EliminateDeadCode(graph_);
2527
LOG_GRAPH("Post exeception or pass elimination: " << *graph_);
2628
}

0 commit comments

Comments
 (0)