Skip to content

Commit 66a05dc

Browse files
authored
Fixed code-snippet with jacrev (#197)
1 parent 38eb9f4 commit 66a05dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ computes vjps given some `cotangents` Tensors.
180180
>>> from functorch import jacrev
181181
>>> x = torch.randn(5)
182182
>>> jacobian = jacrev(torch.sin)(x)
183-
>>> expected = torch.diag(x)
183+
>>> expected = torch.diag(torch.cos(x))
184184
>>> assert torch.allclose(jacobian, expected)
185185
```
186186
Use `jacrev` to compute the jacobian. This can be composed with vmap to produce

0 commit comments

Comments
 (0)