-
Notifications
You must be signed in to change notification settings - Fork 429
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
Windows/WindowsIterator/WindowsDataset #2338
base: main
Are you sure you want to change the base?
Conversation
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.
I'm happy with how it looks and works now.
where | ||
D:, | ||
{ | ||
let size = NonZeroUsize::new(size).expect("window size must be non-zero"); |
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.
I considered not panicking here and passing a NonZeroUsize
instead but I came to the conclusion that not having to declare NonZeroUsize::new(x)
and expect("")
or unwrap()
every single time is worth panicking in the constructor.
If you want to avoid panicking in the constructor, I can update the PR accordingly.
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.
Nan it's fine.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2338 +/- ##
==========================================
- Coverage 85.36% 85.35% -0.01%
==========================================
Files 769 769
Lines 98738 98765 +27
==========================================
+ Hits 84285 84305 +20
- Misses 14453 14460 +7 ☔ View full report in Codecov by Sentry. |
Hey! Thanks for following up on this. I should have time to look at your PR before the end of this week 🙂 |
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.
LGTM, waiting for @laggui before merging.
where | ||
D:, | ||
{ | ||
let size = NonZeroUsize::new(size).expect("window size must be non-zero"); |
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.
Nan it's fine.
Checklist
run-checks all
script has been executed.Related Issues/PRs
Changes
Window
trait for allDataset<I>
Instances.Windows
trait for allDataset<I>
Instances to keepbase.rs
clean.WindowsDataset
.windows
function to return an Iterator because of the lifetime.Testing
cd crates/burn-dataset && cargo test window
Notes
Technically the
windows
function functionality could also be achieved by doing sth like:instead of
That being said, I could imagine use-cases where the
windows
function is used and it would also be kinda neat if you could collect a Dataset from aWindowsIterator
again, but with the current lifetime architecture I was not able to achieve this yet and it is probably more a "nice to have" than anything else.