Skip to content

Commit

Permalink
[TRT] Add fallback to hand-written ROIAlign for TRT prev to 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
doxutx committed Feb 27, 2024
1 parent 8934bc7 commit 70836d0
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ nvinfer1::DataType RoiAlignTRTPluginLayerBuilder::getOutputDataType(int index, c
}

ILayer* RoiAlignTRTPluginLayerBuilder::AddToNetwork(INetworkDefinition* network) noexcept {
#if NV_TENSORRT_MAJOR * 10 + NV_TENSORRT_MINOR >= 84
auto layer_param = dynamic_cast<RoiAlignLayerParam*>(param_);
if (!layer_param) {
LOGE("RoiAlignTRTPluginLayerBuilder: Unable to get layer param.");
Expand Down Expand Up @@ -86,6 +87,9 @@ ILayer* RoiAlignTRTPluginLayerBuilder::AddToNetwork(INetworkDefinition* network)
}

return layer;
#else
return TensorRTPluginLayerBuilder::AddToNetwork(network);
#endif
}

DimsExprs RoiAlignTRTPluginLayerBuilder::getOutputDimensions(int index, const nvinfer1::DimsExprs* inputs,
Expand Down

0 comments on commit 70836d0

Please sign in to comment.