x = torch.tensor(3.0, requires_grad=True) print(x.requires_grad) # True