MadryLab / robustness

A library for experimenting with, training and evaluating neural networks, with a focus on adversarial robustness.
MIT License
903 stars 181 forks source link

Overriding arguments to datasets with None doesn't override #77

Closed andrewilyas closed 3 years ago

andrewilyas commented 4 years ago

Overriding custom class with None doesn't work, since the library takes None to mean nothing is provided:

>>> from robustness import datasets
>>> datasets.CIFAR("", custom_class=None).custom_class
<class 'torchvision.datasets.cifar.CIFAR10'>
andrewilyas commented 4 years ago

Fixed on master. Workaround for current PyPI version of the library:

>>> from robustness import datasets
>>> ds = datasets.CIFAR("")
>>> ds.custom_class = None
andrewilyas commented 3 years ago

This should be fixed in the latest version, closing!