Skip to content

Commit

Permalink
feat: support prim::Param for input type after refactor
Browse files Browse the repository at this point in the history
Signed-off-by: inocsin <vcheungyi@163.com>
  • Loading branch information
inocsin committed Mar 31, 2021
1 parent 965a67a commit 3cebe97
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/partitioning/shape_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ void getSegmentsOutputByRunning(
// 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 3cebe97

Please sign in to comment.