mirror of
https://github.com/wassname/pytorch-for-numpy-users.git
synced 2026-06-27 16:10:21 +08:00
Fix flake8
This commit is contained in:
@@ -112,24 +112,25 @@
|
|||||||
|
|
||||||
### Calculation
|
### Calculation
|
||||||
|
|
||||||
| Numpy | PyTorch |
|
| Numpy | PyTorch |
|
||||||
|:------------|:--------------------------------------|
|
|:--------------|:--------------------------------------|
|
||||||
| `x.min` | `mins, indices = torch.min(x, [dim])` |
|
| `x.min` | `mins, indices = torch.min(x, [dim])` |
|
||||||
| `x.argmin` | `mins, indices = torch.min(x, [dim])` |
|
| `x.argmin` | `mins, indices = torch.min(x, [dim])` |
|
||||||
| `x.max` | `maxs, indices = torch.max(x, [dim])` |
|
| `x.max` | `maxs, indices = torch.max(x, [dim])` |
|
||||||
| `x.argmax` | `maxs, indices = torch.max(x, [dim])` |
|
| `x.argmax` | `maxs, indices = torch.max(x, [dim])` |
|
||||||
| `x.clip` | |
|
| `x.clip` | |
|
||||||
| `x.round` | `y.round` |
|
| `x.round` | `x.round` |
|
||||||
| | `y.floor` |
|
| `np.floor(x)` | `x.floor()` |
|
||||||
| `x.trace` | `y.trace` |
|
| `np.ceil(x)` | `x.ceil()` |
|
||||||
| `x.sum` | `y.sum` |
|
| `x.trace` | `x.trace` |
|
||||||
| `x.cumsum` | `y.cumsum` |
|
| `x.sum` | `x.sum` |
|
||||||
| `x.mean` | `x.mean` |
|
| `x.cumsum` | `x.cumsum` |
|
||||||
| `x.std` | `x.std` |
|
| `x.mean` | `x.mean` |
|
||||||
| `x.prod` | `x.prod` |
|
| `x.std` | `x.std` |
|
||||||
| `x.cumprod` | `x.cumprod` |
|
| `x.prod` | `x.prod` |
|
||||||
| `x.all` | `(y == 1).sum() == y.nelement()` |
|
| `x.cumprod` | `x.cumprod` |
|
||||||
| `x.any` | `(y == 1).sum() > 0` |
|
| `x.all` | `(x == 1).sum() == x.nelement()` |
|
||||||
|
| `x.any` | `(x == 1).sum() > 0` |
|
||||||
|
|
||||||
### Arithmetic and comparison operations
|
### Arithmetic and comparison operations
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user