From 8d3354197ee4509452e6a0cf4ca964db1ba4cfa1 Mon Sep 17 00:00:00 2001 From: Sahas2711 Date: Mon, 9 Nov 2026 21:49:17 +0530 Subject: [PATCH] fix(tutorials): correct polynomial autograd function --- beginner_source/examples_autograd/polynomial_autograd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beginner_source/examples_autograd/polynomial_autograd.py b/beginner_source/examples_autograd/polynomial_autograd.py index d33ca8bcb90..5d03b8f369b 100755 --- a/beginner_source/examples_autograd/polynomial_autograd.py +++ b/beginner_source/examples_autograd/polynomial_autograd.py @@ -28,7 +28,7 @@ # By default, requires_grad=False, which indicates that we do not need to # compute gradients with respect to these Tensors during the backward pass. x = torch.linspace(-1, 1, 2000, dtype=dtype) -y = torch.exp(x) # A Taylor expansion would be 1 + x + (1/2) x**2 + (1/3!) x**3 + ... +y = torch.sin(x) # Create random Tensors for weights. For a third order polynomial, we need # 4 weights: y = a + b x + c x^2 + d x^3