Skip to content
Snippets Groups Projects
Commit 8c69c41b authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Apply 1 suggestion(s) to 1 file(s)

parent 698594a6
No related branches found
No related tags found
2 merge requests!318[Upd] release verision 0.5.0,!291Fix slice for out of bound start and end attributes
Pipeline #62554 passed
......@@ -258,7 +258,7 @@ bool Aidge::Slice_Op::forwardDims(bool allowDataDependency) {
static_cast<DimSize_t>(this->starts()[i]) :
static_cast<DimSize_t>(this->starts()[i] + static_cast<DimSize_t>(getInput(0)->dims()[axis]));
// Clamp start to the range [0, axis_dim]
start = std::max(static_cast<DimSize_t>(0), std::min(start, getInput(0)->dims()[axis]));
start = std::max(static_cast<DimSize_t>(0), std::min(start, getInput(0)->dims()[axis]-1));
DimSize_t end = this->ends()[i] >= 0 ?
static_cast<DimSize_t>(this->ends()[i]) :
......
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