Skip to content
Snippets Groups Projects
Commit 9c1ff3f8 authored by Houssem ROUIS's avatar Houssem ROUIS
Browse files

minor cleanups

parent 6d9de171
No related branches found
No related tags found
No related merge requests found
......@@ -22,10 +22,13 @@ const std::string Aidge::Gather_Op::Type = "Gather";
void Aidge::Gather_Op::computeOutputDims() {
// check inputs have been associated
if (!getInput(0) || !getInput(1)) {
AIDGE_THROW_OR_ABORT(std::runtime_error, "At least one input was not connected");
for(int i=0; i<2; ++i){
if (!getInput(i)) {
AIDGE_THROW_OR_ABORT(std::runtime_error, "{}: input #{} should be associated with a Tensor", type(), i);
}
}
if (!getInput(0)->empty() && !getInput(1)->empty()) {
std::vector<DimSize_t> outDims = getInput(0)->dims();
std::vector<DimSize_t> indicesDims = getInput(1)->dims();
......
......@@ -24,9 +24,11 @@
const std::string Aidge::Slice_Op::Type = "Slice";
void Aidge::Slice_Op::computeOutputDims() {
// check input have been associated
if (!getInput(0) || !getInput(1) || !getInput(2) || !getInput(3)) {
AIDGE_THROW_OR_ABORT(std::runtime_error, "Every input should be associated with a Tensor");
// check inputs have been associated
for(int i=0; i<4; ++i){
if (!getInput(i)) {
AIDGE_THROW_OR_ABORT(std::runtime_error, "{}: input #{} should be associated with a Tensor", type(), i);
}
}
if((!getInput(0)->empty()) && (!getInput(1)->empty()) && (!getInput(2)->empty()) && (!getInput(3)->empty()))
......
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