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

fix types in split's kernel

parent 33386969
No related branches found
No related tags found
2 merge requests!212Version 0.3.0,!201Fix Split kernel
Pipeline #54590 passed
......@@ -37,15 +37,15 @@ void Aidge::Split_OpImpl::forward() {
const std::size_t stride_post = std::accumulate(dims.crbegin(), dims.crbegin() + dims.size() -1 - axis, 1, std::multiplies<std::size_t>());
for (auto i = 0; i < op.nbOutputs(); ++i)
{
DimIdx_t chunkIdxOnAxis = std::accumulate(splits.cbegin(), splits.cbegin() + i, 0) * stride_post;
DimIdx_t offset = 0;
DimSize_t chunkIdxOnAxis = std::accumulate(splits.cbegin(), splits.cbegin() + i, 0) * stride_post;
DimSize_t offset = 0;
for (std::size_t j = 0; j < stride_pre; ++j)
{
// Compute chunk position in input tensor
DimIdx_t idx = j * stride_post * dims[axis] + chunkIdxOnAxis;
DimSize_t idx = j * stride_post * dims[axis] + chunkIdxOnAxis;
// Copy chunk in ouput
op.getOutput(i)->getImpl()->copy(op.getInput(0)->getImpl()->rawPtr(idx),
splits[i] * stride_post, offset);
splits[i] * stride_post, offset);
offset += splits[i] * stride_post;
}
......
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