Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect strides in vxMapTensorPatch #21

Open
dvorotnev opened this issue May 19, 2020 · 1 comment
Open

Incorrect strides in vxMapTensorPatch #21

dvorotnev opened this issue May 19, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@dvorotnev
Copy link

Hello! In the function vxMapTensorPatch from OpenVX v1.3 calculations for the strides seem incorrect.
For example, for a tensor with data type VX_TYPE_INT16 dimensions = {3, 1, 2, 2} and the function params view_start = {0, 0, 0, 0}, view_end = {3, 1, 2, 2} it calculates strides = {2, 2, 4, 8}:

for (vx_uint32 i = 1; i < number_of_dims; i++)
{
    stride[i] = stride[i - 1] * (view_end[i] - view_start[i]);
}

I think that the strides should be calculated as:

for (vx_uint32 i = 1; i < number_of_dims; i++)
{
    stride[i] = stride[i - 1] * (view_end[i - 1] - view_start[i - 1]);
}

and there are strides = {2, 6, 6, 12} for the given example.

dvorotnev pushed a commit to dvorotnev/OpenVX-sample-impl that referenced this issue May 19, 2020
dvorotnev added a commit to dvorotnev/OpenVX-sample-impl that referenced this issue May 19, 2020
@daunclestone
Copy link

daunclestone commented Jun 24, 2020

thank you

actually I dont think it should calculate stride[] using view_end[] and view_start[]. I think it should simpl return the values in tensor->stride[] which are already initialized in ownInitTensor()

@kiritigowda kiritigowda added the bug Something isn't working label Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants