Use Variable.array instead of Variable.data#336
Merged
toslunar merged 6 commits intochainer:masterfrom Oct 17, 2018
Merged
Conversation
Both Variable.shape and Variable.dtype are ready since Chainer v2, so they are used to shrink lines that exceeds 80.
pytest was introduced at v3.1.0.
Member
|
Once we drop Chainer v2 support, we can always use |
Member
Author
|
It seems pytest-cov was missing for v3.1.0 CI, so I added. |
toslunar
requested changes
Oct 17, 2018
chainerrl/misc/prioritized.py
Outdated
| initial_max_priority=1.0): | ||
| self.capacity = capacity | ||
| self.data = collections.deque() | ||
| self.array = collections.deque() |
Member
There was a problem hiding this comment.
.data in the file is not an attribute of Variable.
chainerrl/functions/sum_arrays.py
Outdated
| def forward_gpu(self, inputs): | ||
| n = len(inputs) | ||
| ptrs = cuda.cupy.asarray([x.data.ptr for x in inputs], | ||
| ptrs = cuda.cupy.asarray([x.array.ptr for x in inputs], |
Member
There was a problem hiding this comment.
Please revert the changes to the file.
toslunar
approved these changes
Oct 17, 2018
Member
toslunar
left a comment
There was a problem hiding this comment.
LGTM. I confirmed that all .data in **/*.py is not the attribute of Variable.
I'll merge the PR after I run gpu/slow tests.
Member
Author
|
Thanks for your great 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.
Resolves #335
Chainer v2 support is dropped.