Hi,
I just wrote the following code and I am not getting the answer that I expected.
y = torch.tensor([10], dtype=torch.float32, requires_grad=True)
w = (np.pi*y)/180
f = torch.sin(w)
f.backward()
print(w.grad)

It prints ¸None. Shouldn’t the answer be 0.984807753012208 ? Here is my understanding. we have $f(w) = sin(w)$ where $w=\frac{\pi*y}{180}$. w.grad should give us $\frac{\partial f}{w}\big|_{w=0.1745329}$. However, I am not getting that.
Could someone please help me understand this ?
Thank you!