diff --git a/core/plugins/impl/interpolate_plugin.cpp b/core/plugins/impl/interpolate_plugin.cpp index 1bfb5c1a1b..7960ddb158 100644 --- a/core/plugins/impl/interpolate_plugin.cpp +++ b/core/plugins/impl/interpolate_plugin.cpp @@ -206,14 +206,23 @@ bool InterpolatePlugin::supportsFormatCombination( const nvinfer1::PluginTensorDesc* inOut, int nbInputs, int nbOutputs) noexcept { - TRTORCH_ASSERT(nbInputs == 1, "Expected a single tensor as input to interpolate plugin"); - + if (nbInputs != 1) { + LOG_ERROR("Expected a single tensor as input to interpolate plugin"); + } if (mode_ == "adaptive_max_pool2d") { - TRTORCH_ASSERT(nbOutputs == 2, "Expected 2 tensors as output to interpolate plugin"); - TRTORCH_ASSERT(0 <= pos && pos <= 2, "There should be exactly 3 connections to the plugin - 1 input, 2 output"); + if (nbOutputs != 2) { + LOG_ERROR("Expected 2 tensors as output to interpolate plugin"); + } + if (pos < 0 || pos > 2) { + LOG_ERROR("There should be exactly 3 connections to the plugin - 1 input, 2 output"); + } } else { - TRTORCH_ASSERT(nbOutputs == 1, "Expected a single tensor as output to interpolate plugin"); - TRTORCH_ASSERT(0 <= pos && pos <= 1, "There should be exactly 2 connections to the plugin - 1 input, 1 output"); + if (nbOutputs != 1) { + LOG_ERROR("Expected a single tensor as output to interpolate plugin"); + } + if (pos < 0 || pos > 1) { + LOG_ERROR("There should be exactly 2 connections to the plugin - 1 input, 1 output"); + } } const nvinfer1::PluginTensorDesc& in = inOut[0]; diff --git a/core/plugins/impl/normalize_plugin.cpp b/core/plugins/impl/normalize_plugin.cpp index ca815c82fe..ad47dfa327 100644 --- a/core/plugins/impl/normalize_plugin.cpp +++ b/core/plugins/impl/normalize_plugin.cpp @@ -133,9 +133,15 @@ bool NormalizePlugin::supportsFormatCombination( const nvinfer1::PluginTensorDesc* inOut, int nbInputs, int nbOutputs) noexcept { - TRTORCH_ASSERT(0 <= pos && pos <= 1, "There should be exactly 2 connections to the plugin - 1 input, 1 output"); - TRTORCH_ASSERT(nbInputs == 1, "Expected a single tensor as input to normalize plugin"); - TRTORCH_ASSERT(nbOutputs == 1, "Expected a single tensor as output to normalize plugin"); + if (pos < 0 || pos > 1) { + LOG_ERROR("There should be exactly 2 connections to the plugin - 1 input, 1 output"); + } + if (nbInputs != 1) { + LOG_ERROR("Expected a single tensor as input to normalize plugin"); + } + if (nbOutputs != 1) { + LOG_ERROR("Expected a single tensor as output to normalize plugin"); + } const nvinfer1::PluginTensorDesc& in = inOut[0];