Skip to content

Commit 56b5a53

Browse files
committed
fix: fix the parsing related model loading bug
Signed-off-by: Bo Wang <[email protected]>
1 parent 1a22204 commit 56b5a53

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/compiler.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,11 @@ GraphAndMapping ConstructFallbackGraph(
235235

236236
// the mapping from lowering graph => fallback global graph
237237
std::unordered_map<torch::jit::Value*, torch::jit::Value*> old_to_new_g;
238-
for (auto input : block->inputs()) {
239-
util::getOrAddInputForValue(input, new_g, old_to_new_g);
238+
239+
for (uint64_t i = 0; i < block->inputs().size(); i++) {
240+
auto in_val = new_g->addInput(std::string("input_") + std::to_string(i));
241+
in_val->setType(block->inputs()[i]->type());
242+
old_to_new_g[block->inputs()[i]] = in_val;
240243
}
241244

242245
for (auto& seg_block : segmented_blocks) {

0 commit comments

Comments
 (0)