Skip to content

Commit

Permalink
fix typo ShusenTang#73
Browse files Browse the repository at this point in the history
  • Loading branch information
ShusenTang authored Dec 12, 2019
1 parent c98feb2 commit b792091
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/chapter02_prerequisite/2.3_autograd.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ print(z)
tensor([[2., 4.],
[6., 8.]], grad_fn=<ViewBackward>)
```
现在 `y` 不是一个标量,所以在调用`backward`时需要传入一个和`y`同形的权重向量进行加权求和得到一个标量。
现在 `z` 不是一个标量,所以在调用`backward`时需要传入一个和`z`同形的权重向量进行加权求和得到一个标量。
``` python
v = torch.tensor([[1.0, 0.1], [0.01, 0.001]], dtype=torch.float)
z.backward(v)
Expand Down

0 comments on commit b792091

Please sign in to comment.