Skip to content

fix column slicing constructor #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2024
Merged

Conversation

ruairimoran
Copy link
Collaborator

Fixing the column slice constructor from another DTensor.

The following now works correctly

size_t nRow = 10;
size_t nCol = 2;
DTensor<real_t> d_mat(nRow, nCol);
DTensor<real_t> d_col1(d_mat, 1, 0, 0);
DTensor<real_t> d_col2(d_mat, 1, 1, 1);
std::vector<real_t> col(nRow);
std::iota (std::begin(col), std::end(col), 0);
d_col1.upload(col);
d_col2.upload(col);
std::cout << "col 1:\n" << d_col1;
std::cout << "col 2:\n" << d_col2;
std::cout << "mat :\n" << d_mat;

@ruairimoran ruairimoran self-assigned this Jun 2, 2024
@ruairimoran ruairimoran requested a review from alphaville June 2, 2024 08:21
@ruairimoran ruairimoran merged commit f0fd0ba into main Jun 2, 2024
2 checks passed
@alphaville alphaville deleted the hf/slice-construct-col branch November 7, 2024 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant