Skip to content

Instantly share code, notes, and snippets.

@vaibhavkumar049
Created May 25, 2019 07:14
Show Gist options
  • Save vaibhavkumar049/bfbfa6dc5891506bccc5db7be513a94e to your computer and use it in GitHub Desktop.
Save vaibhavkumar049/bfbfa6dc5891506bccc5db7be513a94e to your computer and use it in GitHub Desktop.
y = x + 5
z = y*y + 1
t = torch.sum(z)
t.backward()
print(x.grad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment