check size for both kernel_h_ and kernel_w_