@@ -1640,12 +1640,17 @@ auto build(
16401640 utils::memzero (owning_index.data_ptrs ().data_handle (), owning_index.data_ptrs ().size (), stream);
16411641 utils::memzero (owning_index.inds_ptrs ().data_handle (), owning_index.inds_ptrs ().size (), stream);
16421642
1643- RAFT_EXPECTS ((centers.extent (1 ) == dim || centers.extent (1 ) == raft::round_up_safe (dim + 1 , 8u )),
1644- " centers must have extent [n_lists, dim] or [n_lists, round_up(dim + 1, 8)]. "
1645- " Got centers.extent(1)=%u, expected dim=%u or round_up(dim + 1, 8)=%u" ,
1646- centers.extent (1 ),
1647- dim,
1648- raft::round_up_safe (dim + 1 , 8u ));
1643+ RAFT_EXPECTS (
1644+ (centers.extent (1 ) == dim || centers.extent (1 ) == raft::round_up_safe (dim + 1 , 8u )) &&
1645+ centers.extent (0 ) == owning_index.n_lists (),
1646+ " centers must have extent [n_lists, dim] or [n_lists, round_up(dim + 1, 8)]. "
1647+ " Got centers.extent(1)=%u, expected dim=%u or round_up(dim + 1, 8)=%u, and "
1648+ " centers.extent(0)=%u, expected n_lists=%u" ,
1649+ centers.extent (1 ),
1650+ dim,
1651+ raft::round_up_safe (dim + 1 , 8u ),
1652+ centers.extent (0 ),
1653+ owning_index.n_lists ());
16491654
16501655 if (centers.extent (1 ) == owning_index.dim_ext ()) {
16511656 raft::copy (owning_index.centers ().data_handle (),
0 commit comments