mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
969986a708
## 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