Skip to content
Snippets Groups Projects
Commit 0d7336ca authored by Maxence Naud's avatar Maxence Naud
Browse files

[Fix] assertion for slices with at least one dim the same size as input dim

parent 987c568c
No related branches found
No related tags found
2 merge requests!46Remove Operator reference to Tensor,!20Draft: Introduction of Tiling
Pipeline #32744 passed
...@@ -102,7 +102,7 @@ public: ...@@ -102,7 +102,7 @@ public:
// xxooo xxxoo // xxooo xxxoo
std::vector<std::size_t> beginningCoords = mInput->getCoord(this->template getAttr<SliceAttr::Beginning>()); std::vector<std::size_t> beginningCoords = mInput->getCoord(this->template getAttr<SliceAttr::Beginning>());
for (std::size_t i = 0; i < DIM; ++i) { for (std::size_t i = 0; i < DIM; ++i) {
if (beginningCoords[i] + this->template getAttr<SliceAttr::SliceDims>()[i] >= mInput->dims()[i]) { if (beginningCoords[i] + this->template getAttr<SliceAttr::SliceDims>()[i] > mInput->dims()[i]) {
printf("ROI of Slice operator out of bounds"); printf("ROI of Slice operator out of bounds");
exit(-1); exit(-1);
} else { } else {
...@@ -164,7 +164,7 @@ public: ...@@ -164,7 +164,7 @@ public:
inline IOIndex_t nbOutputs() const noexcept override final { return 1; } inline IOIndex_t nbOutputs() const noexcept override final { return 1; }
}; };
template <DimIdx_t DIM> template <std::size_t DIM>
inline std::shared_ptr<Node> Slice(std::size_t beginningPos, std::array<DimSize_t, DIM> sliceDims, inline std::shared_ptr<Node> Slice(std::size_t beginningPos, std::array<DimSize_t, DIM> sliceDims,
const std::string &name = "") { const std::string &name = "") {
// FIXME: properly handle default w&b initialization in every cases // FIXME: properly handle default w&b initialization in every cases
......
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