Skip to content

Commit b237311

Browse files
committed
Addressed code review comments
Signed-off-by: Boris Fomitchev <[email protected]>
1 parent c6abb4b commit b237311

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/conversion/converters/converter_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ nvinfer1::ITensor* addPadding(ConversionCtx* ctx, const torch::jit::Node* n, nvi
2424
shuffle_layer->setName((util::node_info(n) + " [Reshape to " + util::toStr(newDims) + ']').c_str());
2525
return shuffle_layer->getOutput(0);
2626
} else {
27-
return nullptr;
27+
return tensor;
2828
}
2929
}
3030

core/conversion/converters/impl/pooling.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ bool PoolingConverter(ConversionCtx* ctx, const torch::jit::Node* n, args& args,
142142
if (pool_type == nvinfer1::PoolingType::kMAX) {
143143
auto dilation = util::toDims(args[4].unwrapToIntList());
144144

145-
TRTORCH_ASSERT(
145+
TRTORCH_CHECK(
146146
dilation == util::toDims(std::vector<int64_t>(dilation.nbDims, 1)),
147147
"Pooling dilation is not supported in TensorRT");
148148

@@ -160,7 +160,7 @@ bool PoolingConverter(ConversionCtx* ctx, const torch::jit::Node* n, args& args,
160160
TRTORCH_CHECK(new_layer, "Unable to create Avg Pooling layer from node: " << *n);
161161
new_layer->setAverageCountExcludesPadding(!count_inlcude_pad);
162162
} else {
163-
TRTORCH_ASSERT(0, "Unsupported pool mode!");
163+
TRTORCH_THROW_ERROR("Unsupported pool mode!");
164164
}
165165

166166
auto padding_mode =

0 commit comments

Comments
 (0)