-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedOpen to be worked onOpen to be worked on
Description
🐛 Bug
In my projects, mypy complains if I don't override transfer_batch_to_device in DataModule. This is probably due to a design choice, since transfer_batch_to_device is an abstract method. However, it's clear that overriding the method is not mandatory, as the same behavior is obtained (probably somewhere else in lightiningmodule and trainer code, I couldn't find it), and therefore I think it shouldn't be abstractmethod
I believe we can design this a little better, by making clear that it's not mandatory to override transfer_batch_to_device
To Reproduce
Simply implement a subclass of DataModule and use mypy to check your code
Expected behavior
I expect to
Environment
- PyTorch Version (e.g., 1.7): `.7
- OS (e.g., Linux): LINUX
- How you installed PyTorch (
conda,pip, source): pip - Build command you used (if compiling from source):
- Python version: 3.8.4
- CUDA/cuDNN version: 11.0
- GPU models and configuration:
- Any other relevant information:
Additional context
awaelchli
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedOpen to be worked onOpen to be worked on