A 3-dimensional conv kernel uses all input channels and “moves” along the three spatial dimensions D, H, W in the standard setup.
How would you like the kernel to operate on the input in your first code snippet?
Since one spatial dimension is missing, I’m not sure, how the kernel should be used in that case.