diff --git a/src/operator/Resize.cpp b/src/operator/Resize.cpp index 8ab6669d198b62886f3126b1b7e01259867b6794..98bffb9e06bc912e65fbd2200a462858cdb28e74 100644 --- a/src/operator/Resize.cpp +++ b/src/operator/Resize.cpp @@ -25,7 +25,7 @@ const std::string Aidge::Resize_Op::Type = "Resize"; -bool Aidge::Resize_Op::forwardDims(bool /*allowDataDependency*/) { +bool Aidge::Resize_Op::forwardDims(bool allowDataDependency) { AIDGE_ASSERT(getInput(0)->nbDims() == 4,\ "input tensor must have dimensions = 4 (batch, channel, height, width)."); @@ -35,12 +35,19 @@ bool Aidge::Resize_Op::forwardDims(bool /*allowDataDependency*/) { if (!getInput(i)) { AIDGE_THROW_OR_ABORT(std::runtime_error, "{}: input #{} not provided", type(), i); } + + if (!allowDataDependency) { + Log::warn("Resize_Op: unable to forwardDims() because output dims are data dependent\ + on input#0 and (input#2 or input#3)"); + return false; + } } if (this->template getAttr<ResizeAttr::NoROI>() && this->template getAttr<ResizeAttr::NoSizes>()) { /* - fmt::print("Condition scales: Input 0 and Input 2 must be provided and must have the same dimension, while Inputs 1 and 3 must not be provided.\n"); + fmt::print("Condition scales: Input#0 and Input#2 must be provided and must have the same dimension,\ + while Inputs#1 and #3 must not be provided.\n"); */ AIDGE_ASSERT(getInput(0)->nbDims() == getInput(2)->size(),\ @@ -62,7 +69,8 @@ bool Aidge::Resize_Op::forwardDims(bool /*allowDataDependency*/) { if (this->template getAttr<ResizeAttr::NoROI>() && this->template getAttr<ResizeAttr::NoScales>()) { /* - fmt::print("Condition sizes: Input 0 and Input 3 must be provided and must have the same dimension, while Inputs 1 and 2 must not be provided.\n"); + fmt::print("Condition sizes: Input#0 and Input#3 must be provided and must have the same dimension,\ + while Inputs#1 and #2 must not be provided.\n"); */ AIDGE_ASSERT(getInput(0)->nbDims() == getInput(3)->size(),\