Skip to content

hotfix / include ptrMatrices in matrix-axis slices #51

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 4 commits into from
Nov 8, 2024

Conversation

ruairimoran
Copy link
Collaborator

Make sure ptrMatrices is included when slicing on matrix axis

@ruairimoran ruairimoran self-assigned this Nov 8, 2024
@ruairimoran ruairimoran changed the title Include ptrMatrices in matrix-axis slices hotfix / include ptrMatrices in matrix-axis slices Nov 8, 2024
When slicing, m_d_ptrMatrices should be nullptr unless nMats>1
@@ -659,10 +661,6 @@ DTensor<T>::DTensor(const DTensor<T> &other, size_t axis, size_t from, size_t to
m_d_data = other.m_d_data + offset;
m_doDestroyData = false;
m_doDestroyPtrMatrices = false;
if (axis != 2) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this because I put m_d_ptrMatrices = nullptr; at the beginning.

if (axis == 2) {
offset = other.m_numRows * other.m_numCols * from;
m_numRows = other.m_numRows;
m_numCols = other.m_numCols;
m_numMats = len;
m_d_ptrMatrices = other.m_d_ptrMatrices + from;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be here (inside if (axis == 2))

Get rid of warning in DTensor<T>::createRandomTensor
ci/script: use pushd/popd instead of cd
update CHANGELOG
Copy link
Member

@alphaville alphaville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ruairimoran I made a couple of changes - we can merge if you're happy with them.

Copy link
Collaborator Author

@ruairimoran ruairimoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ruairimoran ruairimoran merged commit 603fd0b into main Nov 8, 2024
2 checks passed
@alphaville alphaville deleted the hf/slice-ptr-matrices branch December 3, 2024 15:18
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.

2 participants