Skip to content

[BUG] Impossible to use convolve2_nn #323

@c0dearm

Description

@c0dearm

Description

I am using the code from the main branch of this very same repo, because I needed this fix, which is not yet released: #316

Apparently, this fix is breaking completely the convolve2_nn function, or maybe I am doing something stupid.

This is the code I am trying to run:

fn test_conv2d() {
        let x = &arrayfire::constant!(0.5; 4,4,3,16);
        let k = &arrayfire::constant!(1.0; 2,2,3,5);
        let z = arrayfire::convolve2_nn(
            x,
            k,
            arrayfire::dim4!(1, 1, 1, 1),
            arrayfire::dim4!(0, 0, 0, 0),
            arrayfire::dim4!(1, 1, 1, 1),
        );
    }

As you can see it is a convolution with stride 1, 0 padding and 1 dilation.

The following panic happens when trying to execute it:

In function af_convolve2_nn
In file src/api/c/convolve.cpp:347
Invalid argument at index 3
Expected: stride_dims > 0 && stride_dims <= 2
 0# af_convolve2_nn in /lib/libafcpu.so.3
 1# af_convolve2_nn in /lib/libaf.so.3
 2# 0x000056274C38882E in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
 3# 0x000056274C38B00A in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
 4# 0x000056274C371BFA in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
 5# 0x000056274C37C51E in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
 6# 0x000056274C3C8363 in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
 7# 0x000056274C3C714A in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
 8# 0x000056274C3C6310 in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
 9# 0x000056274C3C4B78 in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
10# 0x000056274C3BF511 in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
11# 0x000056274C3A864C in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
12# 0x000056274C3BD517 in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
13# 0x000056274C3BE481 in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
14# 0x000056274C3866D3 in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
15# 0x000056274C37C76B in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
16# 0x000056274C39250E in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
17# 0x000056274C369FF1 in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
18# 0x000056274C3EA68E in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
19# 0x000056274C369FC0 in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
20# 0x000056274C3866FC in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f
21# 0x00007FC70D91AD90 in /lib/x86_64-linux-gnu/libc.so.6
22# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
23# 0x000056274C362595 in /home/aitor/Documents/mushin/target/debug/deps/mushin-6c092483ec26be2f

Looks to me that somehow the stride dimensions are not being passed correctly to the C API.

System Information

ArrayFire v3.8.2 (CPU, 64-bit Linux, build 5752f2dc)

Checklist

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions