Skip to content

Commit

Permalink
Merge pull request #414 from inocsin/bowa_fallback
Browse files Browse the repository at this point in the history
feat: support prim::Param for fallback inputs
  • Loading branch information
bowang007 authored Mar 30, 2021
2 parents 4e32eff + ec2bbf2 commit 77b4dc7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/partitioning/partitioning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ void registerSegmentInOutIValues(
// set inputs ivalues, now supports Tensor/Int to pass argumentes between different segments
for (auto& input : seg_block.raw_inputs()) {
TRTORCH_CHECK(ivalues_maps.count(input), "Could not find mini graph input IValue " << input->debugName());
if (input->type()->isSubtypeOf(torch::jit::TensorType::get())) {
if (input->node()->kind() == torch::jit::prim::Param) {
jit_inputs_ivalues.push_back(ivalues_maps[input]);
} else if (input->type()->isSubtypeOf(torch::jit::TensorType::get())) {
jit_inputs_ivalues.push_back(ivalues_maps[input].toTensor());
} else if (input->type()->isSubtypeOf(torch::jit::IntType::get())) {
jit_inputs_ivalues.push_back(ivalues_maps[input].toInt());
Expand Down

0 comments on commit 77b4dc7

Please sign in to comment.