Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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