Skip to content

Commit

Permalink
Avoid assertion failure to check output is_tensor
Browse files Browse the repository at this point in the history
  • Loading branch information
jovialio committed Nov 24, 2020
1 parent 7eb49ff commit 8135b65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ModelImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,8 @@ Status ModelImporter::importModel(
for (::ONNX_NAMESPACE::ValueInfoProto const& output : graph.output())
{
ASSERT(_importer_ctx.tensors().count(output.name()), ErrorCode::kINVALID_GRAPH);
ASSERT(_importer_ctx.tensors().at(output.name()).is_tensor(), ErrorCode::kUNSUPPORTED_GRAPH);
nvinfer1::ITensor* output_tensor_ptr = &_importer_ctx.tensors().at(output.name()).tensor();
nvinfer1::ITensor* output_tensor_ptr
= &convertToTensor(_importer_ctx.tensors().at(output.name()), &_importer_ctx);
LOG_VERBOSE("Marking " << output_tensor_ptr->getName() << " as output: " << output.name());
output_tensor_ptr->setName(output.name().c_str());
if (output_tensor_ptr->isNetworkInput())
Expand Down

0 comments on commit 8135b65

Please sign in to comment.