Skip to content
ml-recall

#detach

1 question from Deep Learning Frameworks

Timed test

1 question · 1 min · score and explanations at the end

Take a test
Q 1 / 1Score 0 / 0

Question 1: Short answer

mediumAI-checkedDeep Learning Frameworks

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)

a number