Xilinx / finn-base

Open Source Compiler Framework using ONNX as Frontend and IR
https://finn-base.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
29 stars 17 forks source link

Support for non-square input images and kernels for im2col node #20

Closed mmrahorovic closed 3 years ago

mmrahorovic commented 3 years ago

[im2col]: support for non-square input images and kernels. [test_im2col]: added/modified several test cases for (non-)square images and kernels. [test_general_transformation]: changed kernel_size attribute to list of integers instead of integer as required by im2col node. [base]: changed how the floats, ints, strings, tensors, graphs and sparse_tensors field of AttributeProto is set. [lower_convs_to_matmul]: changed kernel_size attribute to list of integer instead of integer.

maltanar commented 3 years ago

Thanks Mirza, looks good! I made some minor style-related changes (it's better to avoid ) before merging and added some comments.

One potential consideration is whether we really need support for the dummy dimension being either in the first or second spatial dimension, e.g. we could restrict 1D conv input tensors to be always represented by (N, C, H, 1) and not supporting the (N, C, 1, W) case. Or are both of these required by QuarzNet in some way?

Having the current capability doesn't hurt but usually the less code there is to maintain the better :)