I am trying to create a Conv2d layer where each batch from the input will be multiply with it’s corresponding kernels. Right now the Conv2d takes as input (N, C_in, W, H) and it has weights of shape (K, K, W, H). I would like to extend the weights to (N, K, K, W, H) so each input will have it’s own set of weights. I tried to manually set the Conv2d.weight.data to the corresponding size but it does not work. Does anyone know how can I achieve this behavior?