Currently you are calculating the sequence length of the activation after self.depthwiseConv as self.seq_length - 2*(self.kernel-1) which is wrong, as the kernel will remove one signal value on each side.
in_features=K*self.channels * (self.seq_length - 2*(self.kernel//2))

should work.