Skip to content

Conversation

@facaiy
Copy link
Contributor

@facaiy facaiy commented May 5, 2018

Fix #7221.

It's my first contribution to pytorch, so any help would be appreciated. Thanks.

@facaiy facaiy force-pushed the ENH/PackedSequence_support_to_method branch from cf4f997 to b0692f9 Compare May 5, 2018 14:07
@facaiy facaiy force-pushed the ENH/PackedSequence_support_to_method branch from b0692f9 to d3865ac Compare May 5, 2018 14:09
test/test_nn.py Outdated
self.assertIs(a, a.to('cpu', dtype=torch.int32))
self.assertEqual(a.long(), a.to(torch.int64))

if torch.cuda.data.is_available():

This comment was marked as off-topic.

return type(self)(self.data.byte(), self.batch_sizes)

def to(self, *args, **kwargs):
r"""Performs dtype and/or device conversion on `self.data`"""

This comment was marked as off-topic.

@facaiy
Copy link
Contributor Author

facaiy commented May 6, 2018

@ssnl Thanks for your review. I think I have resolved both your comments, could you take a look again?
By the way, it seems that we can use python test/run_test to run specific test case locally, does it have any document?

test/test_nn.py Outdated
self.assertEqual(a.long(), a.to(torch.int64))

if torch.cuda.is_available():
for cuda in ['cuda', 'cuda:0' if torch.cuda.data.device_count() == 1 else 'cuda:1']:

This comment was marked as off-topic.

@ssnl
Copy link
Collaborator

ssnl commented May 6, 2018

By the way, you can also look at the CI logs to see the failures.

@facaiy
Copy link
Contributor Author

facaiy commented May 6, 2018

@ssnl Thank you for your help.

Copy link
Collaborator

@ssnl ssnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @facaiy !

@soumith soumith merged commit f1e3872 into pytorch:master May 7, 2018
@facaiy facaiy deleted the ENH/PackedSequence_support_to_method branch May 8, 2018 14:34
weiyangfb pushed a commit to weiyangfb/pytorch that referenced this pull request Jun 11, 2018
* ENH: add to method for PackedSequence

* ENH: return self if possible

* TST: remove extra data

* DOC: add more explanation

* TST: remove extra data

* DOC: minor fix
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.

PackedSequence is missing to method

4 participants