Skip to content

BDCSVD fails for small singular values.

Related TensorFlow issue: https://github.com/tensorflow/tensorflow/issues/26842

Even worse, it accesses an out-of-bounds index in some cases. For example,

Eigen::MatrixXf A = Eigen::MatrixXf::Constant(1000, 1000, 1);
Eigen::BDCSVD<Eigen::MatrixXf, Eigen::ComputeFullU | Eigen::ComputeFullV> svd(A);

causes a memory access error and crash.

It looks like the deflation process is failing, which at some point ends up resulting in a divide-by-zero, which introduces infs and nans at various places.