added typehints for chapter 1 and 2 - tensors & activations.
this enables the students to understand the contract before implementing - which makes them to think about the possible edge cases before implementing.
#1167 - as part of this issue I wanted to cover all the modules. @imuday984 started working on other modules already. Hence, I am pushing just these changes.
These changes are not automatically added by coding assistants. These are manually added (with AI assistance). Because I wanted to make intentional changes and reason every line I add. I request the reviewers to add comments if there is room for improvements.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1195
**Author:** [@harishb00](https://github.com/harishb00)
**Created:** 2/22/2026
**Status:** ✅ Merged
**Merged:** 3/17/2026
**Merged by:** [@profvjreddi](https://github.com/profvjreddi)
**Base:** `dev` ← **Head:** `feature/typehints`
---
### 📝 Commits (3)
- [`a326386`](https://github.com/harvard-edge/cs249r_book/commit/a326386a6bccd0eb84a134138b6d3ad2ff1fd5f3) added typehints to chapter 1 & 2
- [`a96d5d4`](https://github.com/harvard-edge/cs249r_book/commit/a96d5d40db22972d1f9407dd2a1160465004d708) added typehints for chapter 3
- [`9c6c98b`](https://github.com/harvard-edge/cs249r_book/commit/9c6c98bc0f28a69dae344f64ec147c18e15f81f0) remove chapter 3 from PR
### 📊 Changes
**2 files changed** (+32 additions, -23 deletions)
<details>
<summary>View changed files</summary>
📝 `tinytorch/src/01_tensor/01_tensor.py` (+24 -17)
📝 `tinytorch/src/02_activations/02_activations.py` (+8 -6)
</details>
### 📄 Description
* added `typehints` for chapter 1 and 2 - tensors & activations.
* this enables the students to understand the contract before implementing - which makes them to think about the possible edge cases before implementing.
* #1167 - as part of this issue I wanted to cover all the modules. @imuday984 started working on other modules already. Hence, I am pushing just these changes.
* These changes are not automatically added by coding assistants. These are manually added (with AI assistance). Because I wanted to make intentional changes and reason every line I add. I request the reviewers to add comments if there is room for improvements.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1195
Author: @harishb00
Created: 2/22/2026
Status: ✅ Merged
Merged: 3/17/2026
Merged by: @profvjreddi
Base:
dev← Head:feature/typehints📝 Commits (3)
a326386added typehints to chapter 1 & 2a96d5d4added typehints for chapter 39c6c98bremove chapter 3 from PR📊 Changes
2 files changed (+32 additions, -23 deletions)
View changed files
📝
tinytorch/src/01_tensor/01_tensor.py(+24 -17)📝
tinytorch/src/02_activations/02_activations.py(+8 -6)📄 Description
typehintsfor chapter 1 and 2 - tensors & activations.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.