Skip to content

Commit

Permalink
Amend make dense_array.set(..) more generic.
Browse files Browse the repository at this point in the history
  • Loading branch information
bimalgaudel committed May 21, 2024
1 parent f00c2dc commit 4855438
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/TiledArray/conversions/sparse_to_dense.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ to_dense(DistArray<Tile, ArgPolicy> const& sparse_array) {
Tile tile(sparse_array.find(ord).get().clone());
dense_array.set(ord, tile);
} else {
// see DistArray::set(ordinal, element_type)
dense_array.set(ord, typename ArrayType::value_type{});
if constexpr (detail::is_tensor_of_tensor_v<Tile>) {
// `zero' tiles that satisfy detail::is_tensor_of_tensor_v<Tile>
// will be left uninitialized
} else {
// see DistArray::set(ordinal, element_type)
dense_array.set(ord, 0);
}
}
}

Expand Down

0 comments on commit 4855438

Please sign in to comment.