[BUG] Fix PyTorch warning when slicing tensor with non-writable numpy arrays#2276
Open
andersendsa wants to merge 1 commit intosktime:mainfrom
Open
[BUG] Fix PyTorch warning when slicing tensor with non-writable numpy arrays#2276andersendsa wants to merge 1 commit intosktime:mainfrom
andersendsa wants to merge 1 commit intosktime:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2276 +/- ##
=======================================
Coverage ? 86.93%
=======================================
Files ? 166
Lines ? 9765
Branches ? 0
=======================================
Hits ? 8489
Misses ? 1276
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Author
|
Hi @phoeenniixx This pr passes all the tests and is ready for review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Closes : #2273
What does this implement/fix? Explain your changes.
Replaced
.to_numpy()with.tolist()on pandas Series before tensor indexingin
samplers.pyandtest_timeseries.py. This avoids the PyTorch UserWarningabout non-writable numpy arrays, since
.tolist()returns a writable Pythonlist instead of a read-only numpy view from pandas.
PR checklist
The PR title starts with either [ENH], [MNT], [DOC], or [BUG].
[BUG] - bugfix, [MNT] - CI, test framework, [ENH] - adding or improving code, [DOC] - writing or improving documentation or docstrings.
Added/modified tests
Used pre-commit hooks when committing to ensure that code is compliant with hooks.
Installed hooks using
pre-commit installand verified withpre-commit run --all-files.