Question 1: Short answer
mediumAI-checkedDeep Learning FrameworksWhat does the last line print?
x = torch.tensor(3.0, requires_grad=True)
y = x.detach() ** 2 + 2 * x
y.backward()
print(x.grad)1 question from Deep Learning Frameworks
1 question · 1 min · score and explanations at the end
What does the last line print?
x = torch.tensor(3.0, requires_grad=True)
y = x.detach() ** 2 + 2 * x
y.backward()
print(x.grad)