BUG: optimize: fix botched test for scalars

Any row-vector or other ndarray with shape[0] == 0 was passed through.
it's `assert_`, not `assert_true`