Skip to content

Commit

Permalink
Fix pooling for large kernel sizes onnx#937
Browse files Browse the repository at this point in the history
Raise an exception in case an unsupported pooling
operation occurs.

Signed-off-by: Max Huber <maxh@mailbox.org>
  • Loading branch information
drproktor authored and Max Huber committed Sep 12, 2023
1 parent 0462dc3 commit ecbd179
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions onnx2trt_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1509,6 +1509,8 @@ NodeImportResult poolingHelper(IImporterContext* ctx, ::ONNX_NAMESPACE::NodeProt
}

nvinfer1::IPoolingLayer* poolingLayer = ctx->network()->addPoolingNd(*tensorPtr, type, kernel_size);
ASSERT(poolingLayer && "Failed to add pooling layer.", ErrorCode::kUNSUPPORTED_NODE);

poolingLayer->setStrideNd(strides);
// This member is ignored in maxpooling
poolingLayer->setAverageCountExcludesPadding(exclude_padding);
Expand Down

0 comments on commit ecbd179

Please sign in to comment.