Skip to content

Commit

Permalink
fix(aten::max_pool2d): Supressing error due to not filling in stride in
Browse files Browse the repository at this point in the history
the default case

Signed-off-by: Naren Dasan <naren@narendasan.com>
Signed-off-by: Naren Dasan <narens@nvidia.com>
  • Loading branch information
narendasan committed Nov 19, 2020
1 parent 4ee6c20 commit ed3c185
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/conversion/converters/impl/pooling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ bool MaxPoolingConverter(ConversionCtx* ctx, const torch::jit::Node* n, args& ar
auto padding = util::toDims(args[3].unwrapToIntList());
LOG_DEBUG("padding: " << padding);
auto stride = util::toDims(args[2].unwrapToIntList());
if (args[2].unwrapToIntList().size() == 0) {
LOG_DEBUG("Stride not providied, using kernel_size as stride");
stride = util::toDims(args[1].unwrapToIntList());
}
LOG_DEBUG("stride: " << stride);

auto dilation = util::toDims(args[4].unwrapToIntList());
Expand Down Expand Up @@ -88,6 +92,10 @@ bool AvgPoolingConverter(ConversionCtx* ctx, const torch::jit::Node* n, args& ar
auto padding = util::toDims(args[3].unwrapToIntList());
LOG_DEBUG("padding: " << padding);
auto stride = util::toDims(args[2].unwrapToIntList());
if (args[2].unwrapToIntList().size() == 0) {
LOG_DEBUG("Stride not providied, using kernel_size as stride");
stride = util::toDims(args[1].unwrapToIntList());
}
LOG_DEBUG("stride: " << stride);

bool ceil_mode = args[4].unwrapToBool();
Expand Down

0 comments on commit ed3c185

Please sign in to comment.