Skip to content

[BUG] Shift returns incorrect results with arrays with skipped dimensions #3475

Description

@umar456

When performing shift on empty dimensions(i.e. where dimensions are [3 1 3 1]) the shift function breaks and returns incorrect results. This bug was introduced with the memcpy optimization changes because of the dimension reordering.

Description

The JIT preconfiguration steps are broken because of the way we reorder the dimensions for the shift node.

Reproducible Code and/or Steps

void test_shift(int ia=1,int ib=3){
    array a=iota(dim4(ia,ib));
    af_print(a);
    af_print(shift(a,-1));
    af_print(shift(a,1));
    af_print(shift(a,0,-1));
    af_print(shift(a,0,1));
}

System Information

N/A

Checklist

  • Using the latest available ArrayFire release
  • GPU drivers are up to date

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions