Mentions légales du service

Skip to content

Fix bug in DNADataset that occurs on newer pytorch versions

E. Madison Bray requested to merge embray/fix-dnaddataset-configmixin-bug into master

I installed PyTorch 1.10 and started getting an error because of the base class ordering of DNADataset

This is because for some reason the Dataset base class grew an (undocumented AFAICT) system for registering new methods on an existing Dataset class through a new "function" registry. It's probably used for something internally but I'm not sure. It works by implementing Dataset.__getattr__ to look up registered functions in the function registry.

However, it does not behave as a good citizen, and does not call super().getattr(), and instead raises AttributeError on anything not found in its function registry (I will open an upstream bug about this).

Therefore ConfigMixin.getattr was not being called unless it is placed before Dataset in the MRO.

Merge request reports