Skip to content

Commit

Permalink
feat: support prim::Param for fallback inputs
Browse files Browse the repository at this point in the history
Signed-off-by: inocsin <vcheungyi@163.com>
  • Loading branch information
inocsin committed Mar 30, 2021
1 parent 4e32eff commit ec2bbf2
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 ec2bbf2

Please sign in to comment.