Question 1: Single choice
hardAI-checkedPyTorchf doubles its input until the norm reaches 1000 and multiplies by 100 if the sum is not
positive. Now a is a vector:
def f(a):
b = a * 2
while b.norm() < 1000:
b = b * 2
if b.sum() > 0:
c = b
else:
c = 100 * b
return c
a = torch.randn(3, requires_grad=True)
d = f(a)
Which statement is correct?