The d2l package (v1.0.3) provides utility functions and dataset loaders for the textbook 'Dive into Deep Learning' (d2l.ai). It includes common deep learning building blocks, data iterators, and plotting helpers to accompany the book. Release cadence is irregular, tied to book updates.
pip install d2lVerified import paths — ran on the pinned version, not inferred.
Quickstart: Load Fashion-MNIST using d2l's data loader. The d2l package simplifies dataset access and common training loops.
Replace `from d2l.torch import ...` with `from d2l import torch as d2l` or simply `import d2l` and use `d2l.xxx`.
Update imports: use `from d2l import Animator, Accumulator` instead of `from d2l.utils import Animator`.
Set environment variable `D2L_DATA_DIR` to a local directory with pre-downloaded datasets. For offline use, manually copy datasets to ~/.d2l/data/.
Use the torch backend: `from d2l import torch` or `import d2l` (defaults to torch). Avoid importing d2l.mxnet or d2l.tensorflow.