Hi @ptrblck,
Sorry to bother you again.
Now, I have a different kernel size with [3,3,3,3]. How can I resize it for convolutional layer.
x = torch.randn([1, 256, 3, 3, 3])
kernel_x = np.array([[[1, 2, 1], [0, 0, 0], [-1, -2, -1]],
                             [[2, 4, 2], [0, 0, 0], [-2, -4, -2]],
                             [[1, 2, 1], [0, 0, 0], [-1, -2, -1]]])
kernel_y = kernel_x.transpose((1, 0, 2))
kernel_z = self.kernel_x.transpose((0, 2, 1))
sobel_kernel = torch.from_numpy(np.array([self.kernel_x, self.kernel_y, self.kernel_z]).reshape((3, 1, 3, 3, 3))).float()
print('sobel_kernel', sobel_kernel.size())
> ('sobel_kernel', (3, 1, 3, 3, 3))
malignacy = F.conv3d(x, sobel_kernel, stride=1, padding=1, groups=x.size(1))

> RuntimeError: Given groups=256, expected weight to be at least 256 at dimension 0, but got weight of size 3 1 3 3 3 instead

Thank you very much.