KEMBAR78
[DataLoader] default_collate should collate bool list to byte tensors by ssnl · Pull Request #14669 · pytorch/pytorch · GitHub
Skip to content

Conversation

@ssnl
Copy link
Collaborator

@ssnl ssnl commented Dec 1, 2018

Based on #15331 . Review only the last commit.

Fixes #14507.

@ssnl ssnl force-pushed the default_collate_bool branch 4 times, most recently from 9f25989 to d42bee5 Compare December 4, 2018 18:14
@ssnl ssnl force-pushed the default_collate_bool branch from d42bee5 to d3cba2e Compare December 18, 2018 05:52
@ssnl ssnl force-pushed the default_collate_bool branch from d3cba2e to d514b9a Compare December 20, 2018 03:51
return torch.DoubleTensor(batch)
return torch.tensor(batch, dtype=torch.float64)
elif isinstance(batch[0], int_classes):
return torch.tensor(batch)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This makes List[int] a long tensor, and List[bool] a byte tensor.

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

Kind of indirect, but ok.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ezyang
Copy link
Contributor

ezyang commented Jan 3, 2019

Laurens van der Maaten says that this broke some internal tests. I'm asking him for some more details

@ssnl
Copy link
Collaborator Author

ssnl commented Jan 3, 2019

@soumith said that he fixed the internal errors before landing.

@soumith
Copy link
Member

soumith commented Jan 3, 2019

i reran the internal tests and they passed :-/

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.

default_collate unexpected types

4 participants