Skip to content
ml-recall

#gradient-accumulation

3 questions from Deep Learning Frameworks, PyTorch

Timed test

3 questions · 3 min · score and explanations at the end

Take a test
Q 1 / 3Score 0 / 0

Question 1: Short answer

mediumAI-checkedDeep Learning Frameworks

What does the last line print?

x = torch.tensor(2.0, requires_grad=True)
for _ in range(3):
    y = x ** 2
    y.backward()
print(x.grad)

a number