Skip to content

Commit

Permalink
fix(//core/conversion/converters/impl): Fix interpolate.cpp
Browse files Browse the repository at this point in the history
Signed-off-by: Abhiram Iyer <abhirami@nvidia.com>

Signed-off-by: Abhiram Iyer <abhi.iyer.ai@gmail.com>
  • Loading branch information
abhi-iyer committed Jun 8, 2020
1 parent 9a4f6de commit b6942a2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/conversion/converters/impl/interpolate.cpp
Expand Up @@ -11,10 +11,10 @@ namespace converters {
namespace impl {
namespace {

auto interpolate_registrations = RegisterNodeConversionPatterns()
auto interpolate_registrations TRTORCH_UNUSED = RegisterNodeConversionPatterns()
.pattern({
"aten::upsample_nearest1d(Tensor self, int[1] output_size, float? scales=None) -> (Tensor)",
[](ConversionCtx* ctx, const torch::jit::Node*n, args& args) -> bool {
[](ConversionCtx* ctx, const torch::jit::Node* n, args& args) -> bool {
auto in = args[0].ITensor();
auto in_shape = util::toVec(in->getDimensions());

Expand All @@ -37,7 +37,7 @@ auto interpolate_registrations = RegisterNodeConversionPatterns()
auto layer_output = ctx->AssociateValueAndTensor(n->outputs()[0], resize_layer->getOutput(0));
LOG_DEBUG("Output tensor shape: " << layer_output->getDimensions());
} else {
LOG_DEBUG("scale factor parameter not supported yet.");
TRTORCH_THROW_ERROR("Unable to retrieve all node inputs for node: " << util::node_info(n) << "\nScale factor parameter not supported yet");
}

return true;
Expand Down Expand Up @@ -67,14 +67,14 @@ auto interpolate_registrations = RegisterNodeConversionPatterns()
auto layer_output = ctx->AssociateValueAndTensor(n->outputs()[0], resize_layer->getOutput(0));
LOG_DEBUG("Output tensor shape: " << layer_output->getDimensions());
} else {
LOG_DEBUG("scale factor parameters not supported yet.");
TRTORCH_THROW_ERROR("Unable to retrieve all node inputs for node: " << util::node_info(n) << "\nScale factor parameter not supported yet");
}

return true;
}
}).pattern({
"aten::upsample_nearest3d(Tensor self, int[3] output_size, float? scales_d=None, float? scales_h=None, float? scales_w=None) -> (Tensor)",
[](ConversionCtx* ctx, const torch::jit::Node*n, args& args) -> bool {
[](ConversionCtx* ctx, const torch::jit::Node* n, args& args) -> bool {
auto in = args[0].ITensor();
auto in_shape = util::toVec(in->getDimensions());

Expand All @@ -97,7 +97,7 @@ auto interpolate_registrations = RegisterNodeConversionPatterns()
auto layer_output = ctx->AssociateValueAndTensor(n->outputs()[0], resize_layer->getOutput(0));
LOG_DEBUG("Output tensor shape: " << layer_output->getDimensions());
} else {
LOG_DEBUG("scale factor parameters not supported yet.");
TRTORCH_THROW_ERROR("Unable to retrieve all node inputs for node: " << util::node_info(n) << "\nScale factor parameter not supported yet");
}

return true;
Expand Down

0 comments on commit b6942a2

Please sign in to comment.