Skip to content
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

move it to the memset. #3556

Closed
github-actions bot opened this issue Mar 19, 2024 · 3 comments · Fixed by #3600
Closed

move it to the memset. #3556

github-actions bot opened this issue Mar 19, 2024 · 3 comments · Fixed by #3600

Comments

@github-actions
Copy link

Line: 565

row_em[idx_value] = (dd - avg[type[bid] * ndescrpt + idx_value]) /
std[type[bid] * ndescrpt + idx_value];
} else {
// TODO: move it to the memset.
row_em[idx_value] -= avg[type[bid] * ndescrpt + idx_value] /
std[type[bid] * ndescrpt + idx_value];
}
}
}
namespace deepmd {

@njzjz
Copy link
Member

njzjz commented Mar 21, 2024

Hi @denghuilu, Using memset for non-zero values is incorrect. See https://stackoverflow.com/questions/17288859/using-memset-for-integer-array-in-c. If you agree, let's remove this TODO.

@denghuilu
Copy link
Member

LGTM

njzjz added a commit to njzjz/deepmd-kit that referenced this issue Mar 25, 2024
@njzjz njzjz linked a pull request Mar 25, 2024 that will close this issue
github-merge-queue bot pushed a commit that referenced this issue Mar 26, 2024
Copy link
Author

Closed in commit 625e893

njzjz added a commit to njzjz/deepmd-kit that referenced this issue Apr 6, 2024
Fix deepmodeling#3556.

Signed-off-by: Jinzhe Zeng <[email protected]>
(cherry picked from commit 625e893)
njzjz added a commit that referenced this issue Apr 6, 2024
Fix #3556.

Signed-off-by: Jinzhe Zeng <[email protected]>
(cherry picked from commit 625e893)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants