File tree Expand file tree Collapse file tree 2 files changed +24
-9
lines changed Expand file tree Collapse file tree 2 files changed +24
-9
lines changed Original file line number Diff line number Diff line change @@ -206,14 +206,23 @@ bool InterpolatePlugin::supportsFormatCombination(
206
206
const nvinfer1::PluginTensorDesc* inOut,
207
207
int nbInputs,
208
208
int nbOutputs) noexcept {
209
- TRTORCH_ASSERT (nbInputs == 1 , " Expected a single tensor as input to interpolate plugin" );
210
-
209
+ if (nbInputs != 1 ) {
210
+ LOG_ERROR (" Expected a single tensor as input to interpolate plugin" );
211
+ }
211
212
if (mode_ == " adaptive_max_pool2d" ) {
212
- TRTORCH_ASSERT (nbOutputs == 2 , " Expected 2 tensors as output to interpolate plugin" );
213
- TRTORCH_ASSERT (0 <= pos && pos <= 2 , " There should be exactly 3 connections to the plugin - 1 input, 2 output" );
213
+ if (nbOutputs != 2 ) {
214
+ LOG_ERROR (" Expected 2 tensors as output to interpolate plugin" );
215
+ }
216
+ if (pos < 0 || pos > 2 ) {
217
+ LOG_ERROR (" There should be exactly 3 connections to the plugin - 1 input, 2 output" );
218
+ }
214
219
} else {
215
- TRTORCH_ASSERT (nbOutputs == 1 , " Expected a single tensor as output to interpolate plugin" );
216
- TRTORCH_ASSERT (0 <= pos && pos <= 1 , " There should be exactly 2 connections to the plugin - 1 input, 1 output" );
220
+ if (nbOutputs != 1 ) {
221
+ LOG_ERROR (" Expected a single tensor as output to interpolate plugin" );
222
+ }
223
+ if (pos < 0 || pos > 1 ) {
224
+ LOG_ERROR (" There should be exactly 2 connections to the plugin - 1 input, 1 output" );
225
+ }
217
226
}
218
227
219
228
const nvinfer1::PluginTensorDesc& in = inOut[0 ];
Original file line number Diff line number Diff line change @@ -133,9 +133,15 @@ bool NormalizePlugin::supportsFormatCombination(
133
133
const nvinfer1::PluginTensorDesc* inOut,
134
134
int nbInputs,
135
135
int nbOutputs) noexcept {
136
- TRTORCH_ASSERT (0 <= pos && pos <= 1 , " There should be exactly 2 connections to the plugin - 1 input, 1 output" );
137
- TRTORCH_ASSERT (nbInputs == 1 , " Expected a single tensor as input to normalize plugin" );
138
- TRTORCH_ASSERT (nbOutputs == 1 , " Expected a single tensor as output to normalize plugin" );
136
+ if (pos < 0 || pos > 1 ) {
137
+ LOG_ERROR (" There should be exactly 2 connections to the plugin - 1 input, 1 output" );
138
+ }
139
+ if (nbInputs != 1 ) {
140
+ LOG_ERROR (" Expected a single tensor as input to normalize plugin" );
141
+ }
142
+ if (nbOutputs != 1 ) {
143
+ LOG_ERROR (" Expected a single tensor as output to normalize plugin" );
144
+ }
139
145
140
146
const nvinfer1::PluginTensorDesc& in = inOut[0 ];
141
147
You can’t perform that action at this time.
0 commit comments