I think in most cases “kernel” and “weight” are used interchangeably for convolutions. For example, “kernel size” usually specifies the spatial dimensions of the weight tensor.
As for the torch.stack ([torch.mean (trained_kernel, 1)] * 6, dim = 1) here, I don’t think that is very common, but it is a simple way to reinitialize the first layer for a model when it was trained for three channel input images and the new task has six channel input images. My guess would be that it might help prevent changing the downstream layers too much (compared to completely random reinitialization) during finetuning. Then again, I wonder if batchnorm might do something similar already.