Skip to content

Instantly share code, notes, and snippets.

@vaibhavkumar049
Created May 25, 2019 08:37
Show Gist options
  • Save vaibhavkumar049/d88d262fcbd3b52e5c67c7b36e768dfb to your computer and use it in GitHub Desktop.
Save vaibhavkumar049/d88d262fcbd3b52e5c67c7b36e768dfb 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