Skip to content

Instantly share code, notes, and snippets.

@vaibhavkumar049
Created May 25, 2019 08:36
Show Gist options
  • Save vaibhavkumar049/cb22249bfd188875cd8fe135ef15b5f3 to your computer and use it in GitHub Desktop.
Save vaibhavkumar049/cb22249bfd188875cd8fe135ef15b5f3 to your computer and use it in GitHub Desktop.
x = torch.ones([3, 2], requires_grad=True)
y = x + 5
r = 1/(1 + torch.exp(-y))
a = torch.ones([3, 2])
r.backward(a)
print(x.grad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment