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
2 merge requests!152Update Aidge export to take a graph view has an argument instead of a...,!93Change Gather and Slice's attributes into intputs
...@@ -22,10 +22,13 @@ const std::string Aidge::Gather_Op::Type = "Gather"; ...@@ -22,10 +22,13 @@ const std::string Aidge::Gather_Op::Type = "Gather";
void Aidge::Gather_Op::computeOutputDims() { void Aidge::Gather_Op::computeOutputDims() {
// check inputs have been associated // check inputs have been associated
if (!getInput(0) || !getInput(1)) { for(int i=0; i<2; ++i){
AIDGE_THROW_OR_ABORT(std::runtime_error, "At least one input was not connected"); 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()) { if (!getInput(0)->empty() && !getInput(1)->empty()) {
std::vector<DimSize_t> outDims = getInput(0)->dims(); std::vector<DimSize_t> outDims = getInput(0)->dims();
std::vector<DimSize_t> indicesDims = getInput(1)->dims(); std::vector<DimSize_t> indicesDims = getInput(1)->dims();
......
...@@ -24,9 +24,11 @@ ...@@ -24,9 +24,11 @@
const std::string Aidge::Slice_Op::Type = "Slice"; const std::string Aidge::Slice_Op::Type = "Slice";
void Aidge::Slice_Op::computeOutputDims() { void Aidge::Slice_Op::computeOutputDims() {
// check input have been associated // check inputs have been associated
if (!getInput(0) || !getInput(1) || !getInput(2) || !getInput(3)) { for(int i=0; i<4; ++i){
AIDGE_THROW_OR_ABORT(std::runtime_error, "Every input should be associated with a Tensor"); 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())) 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