Applying two kernels to different part of the training data

I think it is the right way to do it. To be sure, you can test for a simple D1=D2=1 case.