[Kern] added assertion for inputs X being matrix (ndim == 2)