Skip to content

Commit

Permalink
[Bugfix] Use correct num_triplets
Browse files Browse the repository at this point in the history
  • Loading branch information
junwha0511 committed Mar 31, 2024
1 parent 52b24f3 commit c1fb92a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion taichi/program/sparse_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ void make_sparse_matrix_from_ndarray(Program *prog,
const Ndarray &ndarray) {
std::string sdtype = taichi::lang::data_type_name(sm.get_data_type());
auto data_ptr = prog->get_ndarray_data_ptr_as_int(&ndarray);
auto num_triplets = ndarray.get_nelement() * ndarray.get_element_size() / 3;
auto num_triplets = ndarray.get_nelement();
if (sdtype == "f32") {
build_ndarray_template<float32>(sm, data_ptr, num_triplets);
} else if (sdtype == "f64") {
Expand Down

0 comments on commit c1fb92a

Please sign in to comment.