d2l-ai / d2l-en

Interactive deep learning book with multi-framework code, math, and discussions. Adopted at 500 universities from 70 countries including Stanford, MIT, Harvard, and Cambridge.
https://D2L.ai
Other
22.45k stars 4.19k forks source link

Add type hinting to functions #2571

Open f0lie opened 7 months ago

f0lie commented 7 months ago

Sometimes it's hard to understand the intent of the code without type hints. It would help a lot in understand the the pieces of code that is added to classes.

It would likely take a while to migrate all functions to type hinting, but it's still worth discussing it in a bug.

hiepdang-ml commented 3 months ago

Agree! I found the book has great content but the code was poorly written by not following coding standards. No docstrings, no code comments, no type hints, poorly named variables. I hope they will rework on the code in later versions.