dfdx
dfdx copied to clipboard
`Conv2d` with non square kernel/stride/padding/dilation
How would I create a kernel with a non-square/rectangular shape? Something like:
Conv2D<_, _, (5, 3)>
Currently unsupported, but definitely interested in supporting this (plus strides/padding with different values for both dimensions). The underlying internals updates will be fairly straightforward (though maybe numerous).
The main challenge here will be figuring out to support 1d kernel size and 2d kernel ergonomically. This is another place I wish you could use tuples of usizes in const setting, but we may need to depend on trait Shape
or something similar here:
Conv2D<(Const<3>, ) , 2, 1>
Conv2D<(Const<3>, Const<2>),
The downside of moving to shapes/dims is then I don't think we can support Conv2D<3, 2, 1>
anymore 😩
One thing we could do is add this to the tensor op level (so someone could then easily add their own nn Conv2D wrapped around this), but not add it to the dfdx nn Conv2D.