Learn Before
Example
Example: Gradient of the Sum Function
Consider the scalar-valued sum function , which computes the sum of the elements of a vector . The gradient of this function with respect to is a vector of ones. When calculating this gradient in deep learning frameworks, it is often necessary to first reset or clear the gradient buffer to prevent the new gradient from accumulating with any previously stored gradients.
0
1
Updated 2026-05-02
Tags
D2L
Dive into Deep Learning @ D2L