Skip to content
Snippets Groups Projects
Commit 167021e1 authored by Wissam Boussella's avatar Wissam Boussella
Browse files

new comments for Conv.hpp and Conv.cpp

parent 6c8e206e
No related branches found
No related tags found
No related merge requests found
......@@ -164,8 +164,10 @@ public:
AIDGE_THROW_OR_ABORT(std::runtime_error, "Convolution operator has no weight Tensor associated so no specific number of input channel imposed.");
}
// check format
if(getInput(1)->dataFormat()==Aidge::DataFormat::NHWC)
return getInput(1)->template dims<DIM+2>()[DIM+1];
// default format is NCHW
return getInput(1)->template dims<DIM+2>()[1];
}
......@@ -178,6 +180,7 @@ public:
if (!getInput(1)) {
AIDGE_THROW_OR_ABORT(std::runtime_error, "Convolution operator has no weight Tensor associated so no specific number of output channel imposed.");
}
// first weight dimension for both NCHW (Cout,Cin,H,W) and NHWC (Cout,H,W,Cin) data format
return getInput(1)->template dims<DIM+2>()[0];
}
......
......@@ -46,7 +46,7 @@ bool Aidge::Conv_Op<DIM>::forwardDims(bool /*allowDataDependency*/) {
if(getInput(0)->dataFormat() == Aidge::DataFormat::NHWC){
AIDGE_ASSERT((getInput(0)->nbDims() == (DIM+2)) &&
(getInput(0)->template dims<DIM+2>()[DIM+1] == inChannels()),
"Wrong input size ({}) for Conv operator. Expected dims are [{}, {}, x].", getInput(0)->dims(), inChannels(), fmt::join(std::vector<std::string>(DIM, "x"), ", "));
"Wrong input size ({}) for Conv operator. Expected dims are [x, {}, {}].", getInput(0)->dims(), fmt::join(std::vector<std::string>(DIM, "x"), ", "), inChannels());
}
else{ //For dataFormat in NCHW or Default Format
AIDGE_ASSERT((getInput(0)->nbDims() == (DIM+2)) &&
......
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