Skip to content
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

remove obsolete test/test_datasets_transforms.py #3867

Merged
merged 1 commit into from
May 21, 2021

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented May 21, 2021

The deleted file tests if the transform and target_transform work properly for datasets.ImageFolder. With the dataset tests rework, we now automatically test transform, target_transform, and transforms for every dataset:

@test_all_configs
def test_transforms(self, config):
mock = unittest.mock.Mock(wraps=lambda *args: args[0] if len(args) == 1 else args)
for kwarg in self._TRANSFORM_KWARGS:
if kwarg not in self._HAS_SPECIAL_KWARG:
continue
mock.reset_mock()
with self.subTest(kwarg=kwarg):
with self.create_dataset(config, **{kwarg: mock}) as (dataset, _):
dataset[0]
mock.assert_called()

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

thanks @pmeier

@NicolasHug NicolasHug merged commit 9522678 into pytorch:master May 21, 2021
@pmeier pmeier deleted the dataset-transform-tests branch May 21, 2021 08:22
facebook-github-bot pushed a commit that referenced this pull request May 25, 2021
Reviewed By: vincentqb, cpuhrsch

Differential Revision: D28677182

fbshipit-source-id: c7fd3e203d680f2968a6dfdd3acb1e889b9e21a4
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.

3 participants