Files
pytorch/docs/source/scripts
Subin George 969986a708 [docs] Remove misleading GLU activation image (#173617)
## Summary
The GLU (Gated Linear Unit) documentation referenced an activation plot that was generated by passing identical values for both halves of the input tensor. Since GLU computes `a * sigmoid(b)` where `a` and `b` are the split halves, when `a = b = x` the result is `x * sigmoid(x)`, which is exactly SiLU.

This caused the GLU plot to look identical to SiLU, which is misleading since GLU is fundamentally different - it operates on two input halves rather than being a simple single-input activation function.

## Changes
1. Removed the misleading image reference from the GLU docstring in `torch/nn/modules/activation.py`
2. Removed GLU from the `build_activation_images.py` script since a simple 1D input-output plot doesn't meaningfully represent GLU's behavior
3. Cleaned up the now-unused GLU special case code in `plot_function()`

## Test Plan
Documentation-only change. No functional code changes.

Fixes #167240

Pull Request resolved: https://github.com/pytorch/pytorch/pull/173617
Approved by: https://github.com/soulitzer
2026-01-29 17:11:09 +00:00
..