Skip to content
Snippets Groups Projects
Commit 8927fffc authored by Michal Szczepanski's avatar Michal Szczepanski
Browse files

allowDataDependency in resize operator use

parent ff7ac65f
No related branches found
No related tags found
2 merge requests!152Update Aidge export to take a graph view has an argument instead of a...,!125Operator resize
......@@ -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(),\
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment