Commit 6a72aaa
[`torch.max`](https://pytorch.org/docs/stable/generated/torch.max.html#torch.max) optional args `dim`, `keepdim` not described in document, but users can ignore them.
```python
>>> import torch
>>> a = torch.randn(3,1,3)
>>> a.max()
tensor(1.9145)
>>> a.max(dim=1)
torch.return_types.max(
values=tensor([[ 1.1436, -0.0728, 1.3312],
[-0.4049, 0.1792, -1.2247],
[ 0.8767, -0.7888, 1.9145]]),
indices=tensor([[0, 0, 0],
[0, 0, 0],
[0, 0, 0]]))
```
## Changes
- Add `optional` description for `dim`, `keepdim`
- Add example of using `dim`, `keepdim`
## Test Result
### Before

### After

Pull Request resolved: pytorch#147177
Approved by: https://github.com/colesbury
1 parent 452315c commit 6a72aaa
1 file changed
+17
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| |||
6483 | 6488 | | |
6484 | 6489 | | |
6485 | 6490 | | |
6486 | | - | |
6487 | | - | |
| 6491 | + | |
| 6492 | + | |
6488 | 6493 | | |
6489 | 6494 | | |
6490 | 6495 | | |
| |||
6499 | 6504 | | |
6500 | 6505 | | |
6501 | 6506 | | |
| 6507 | + | |
| 6508 | + | |
| 6509 | + | |
| 6510 | + | |
| 6511 | + | |
| 6512 | + | |
| 6513 | + | |
| 6514 | + | |
| 6515 | + | |
6502 | 6516 | | |
6503 | 6517 | | |
6504 | 6518 | | |
6505 | 6519 | | |
6506 | 6520 | | |
6507 | 6521 | | |
6508 | | - | |
| 6522 | + | |
6509 | 6523 | | |
6510 | 6524 | | |
6511 | 6525 | | |
| |||
0 commit comments