Skip to content

Conversation

iacolippo
Copy link
Contributor

Both conditional branches in __init__ were executed, since classes for test
becomes a list and if was used instead of elif.

Both conditional branches in `__init__` were executed, since `classes` for test
becomes a list and `if` was used instead of `elif`.
else:
classes = [c + '_' + classes for c in categories]
if type(classes) == list:
elif type(classes) == list:

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@fmassa fmassa merged commit c933729 into pytorch:master Apr 4, 2018
@fmassa
Copy link
Member

fmassa commented Apr 4, 2018

Thanks!
About changing it to isinstance, that is indeed more pythonic, but we would ideally also want to handle py2/py3 compatibility (using something like https://github.com/pytorch/pytorch/blob/master/torch/_six.py#L29-L32)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants