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
tensor.clear() to delete all samples from tensor #1288
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1288 +/- ##
==========================================
+ Coverage 92.37% 92.45% +0.07%
==========================================
Files 200 200
Lines 17984 18202 +218
==========================================
+ Hits 16613 16828 +215
- Misses 1371 1374 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -55,6 +57,8 @@ def frombuffer(cls, data: bytes) -> "CommitDiff": | |||
int.from_bytes(data[27 + i * 8 : 35 + i * 8], "big") | |||
for i in range(num_updates) | |||
} | |||
pos = 35 + num_updates * 8 | |||
commit_diff.cleared = bool(int.from_bytes(data[pos : pos + 1], "big")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will not work for older datasets, should have an if-else condition here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, preferably have this boolean flag stored at the start along with the other booleans
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is fine right now since we are taking a slice of data
. If we really want to move it up, what exactly will the if condition look like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small changes, overall looks good!
🚀 🚀 Pull Request
Checklist:
coverage-rate
upChanges
Added method to delete all samples from tensor.
Closes #1165.