How could I implement a gradient filter for each channel using a convolution layer ?
I wrote something that looks like it does what I expected, but not quite some edges are not detected at all and the colors don't seem consistent.
Maybe I don't understand how tensor multiplication work or something, I admit that the fact that the weight matrix is supposed to be 3x3x3x3 is confusing to me. I know it's because there are three output channels for each colors, three input channels for each input colors and 3x3 matrices for convolution filters, but maybe I'm confused about in which ordered they are arranged.

PS. I think I should add a bias: