[GH-ISSUE #1689] [TinyTorch] GELU implementation missing from module 2 docs #21575

Closed
opened 2026-06-04 21:27:35 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @bdub-1 on GitHub (May 6, 2026).
Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/1689

Module

02 Activations

Type of Improvement

Better explanation or documentation

Description

The GELU implementation is missing for the core concepts section.

Proposed Solution

Include this code as implementation along with necessary GELU supporting info. Logically this section seems to belong after #sigmoid-and-tanh and before #softmax-and-numerical-stability.

class GELU:
    def forward(self, x: Tensor) -> Tensor:
        """Apply GELU activation using the fast sigmoid approximation."""
        return Sigmoid()(x * 1.702) * x
Originally created by @bdub-1 on GitHub (May 6, 2026). Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/1689 ### Module 02 Activations ### Type of Improvement Better explanation or documentation ### Description The GELU implementation is missing for the [core concepts](https://mlsysbook.ai/tinytorch/modules/02_activations.html#core-concepts) section. ### Proposed Solution Include this code as implementation along with necessary GELU supporting info. Logically this section seems to belong after `#sigmoid-and-tanh` and before `#softmax-and-numerical-stability`. ```py class GELU: def forward(self, x: Tensor) -> Tensor: """Apply GELU activation using the fast sigmoid approximation.""" return Sigmoid()(x * 1.702) * x ```
GiteaMirror added the area: booktype: improvementarea: tinytorchtype: bug labels 2026-06-04 21:27:36 -05:00
Author
Owner

@Shashank-Tripathi-07 commented on GitHub (May 6, 2026):

Thanks !

I'll make a PR on this in a few hours and submit it.

<!-- gh-comment-id:4389435550 --> @Shashank-Tripathi-07 commented on GitHub (May 6, 2026): Thanks ! I'll make a PR on this in a few hours and submit it.
Author
Owner

@bdub-1 commented on GitHub (May 6, 2026):

Please see the linked PR!

<!-- gh-comment-id:4389518791 --> @bdub-1 commented on GitHub (May 6, 2026): Please see the linked PR!
Author
Owner

@Shashank-Tripathi-07 commented on GitHub (May 6, 2026):

Saw it, done correctly. Very good !!

PR will be merged by @profvjreddi in his own time 🤝🏻

<!-- gh-comment-id:4389614928 --> @Shashank-Tripathi-07 commented on GitHub (May 6, 2026): Saw it, done correctly. Very good !! PR will be merged by @profvjreddi in his own time 🤝🏻
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#21575