Skip to content

Use Variable.array instead of Variable.data#336

Merged
toslunar merged 6 commits intochainer:masterfrom
muupan:use-array-instead-of-data
Oct 17, 2018
Merged

Use Variable.array instead of Variable.data#336
toslunar merged 6 commits intochainer:masterfrom
muupan:use-array-instead-of-data

Conversation

@muupan
Copy link
Copy Markdown
Member

@muupan muupan commented Oct 17, 2018

Resolves #335

Chainer v2 support is dropped.

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.
@muupan muupan requested a review from toslunar October 17, 2018 13:32
@toslunar toslunar self-assigned this Oct 17, 2018
@toslunar
Copy link
Copy Markdown
Member

Once we drop Chainer v2 support, we can always use F.matmul in place of matmul_v3. This can be done in another PR.

@muupan
Copy link
Copy Markdown
Member Author

muupan commented Oct 17, 2018

It seems pytest-cov was missing for v3.1.0 CI, so I added.

initial_max_priority=1.0):
self.capacity = capacity
self.data = collections.deque()
self.array = collections.deque()
Copy link
Copy Markdown
Member

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.

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],
Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member

@toslunar toslunar left a 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.

@muupan
Copy link
Copy Markdown
Member Author

muupan commented Oct 17, 2018

Thanks for your great review!

@toslunar toslunar merged commit c85a20c into chainer:master Oct 17, 2018
@toslunar toslunar added this to the v0.5 milestone Oct 18, 2018
@muupan muupan modified the milestone: v0.5 Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants