-
Notifications
You must be signed in to change notification settings - Fork 224
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
Use Variable.array instead of Variable.data #336
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.
Once we drop Chainer v2 support, we can always use |
It seems pytest-cov was missing for v3.1.0 CI, so I added. |
chainerrl/misc/prioritized.py
Outdated
@@ -17,15 +17,15 @@ class PrioritizedBuffer (object): | |||
def __init__(self, capacity=None, wait_priority_after_sampling=True, | |||
initial_max_priority=1.0): | |||
self.capacity = capacity | |||
self.data = collections.deque() | |||
self.array = collections.deque() |
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.
.data
in the file is not an attribute of Variable
.
chainerrl/functions/sum_arrays.py
Outdated
@@ -21,7 +21,7 @@ def backward(self, inputs, grads): | |||
|
|||
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], |
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.
Please revert the changes to the file.
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. I confirmed that all .data
in **/*.py
is not the attribute of Variable
.
I'll merge the PR after I run gpu/slow tests.
Thanks for your great review! |
Resolves #335
Chainer v2 support is dropped.