mirror of
https://github.com/wassname/pytorch-for-numpy-users.git
synced 2026-06-27 16:10:21 +08:00
Update types
This commit is contained in:
@@ -9,11 +9,13 @@
|
|||||||
|
|
||||||
| Numpy | PyTorch |
|
| Numpy | PyTorch |
|
||||||
|:-------------|:---------------------|
|
|:-------------|:---------------------|
|
||||||
| `np.uint8` | `torch.ByteTensor` |
|
|
||||||
| `np.int32` | `torch.IntTensor` |
|
|
||||||
| `np.int64` | `torch.LongTensor` |
|
|
||||||
| `np.float32` | `torch.FloatTensor` |
|
| `np.float32` | `torch.FloatTensor` |
|
||||||
| `np.float64` | `torch.DoubleTensor` |
|
| `np.float64` | `torch.DoubleTensor` |
|
||||||
|
| `np.int8` | `torch.CharTensor` |
|
||||||
|
| `np.uint8` | `torch.ByteTensor` |
|
||||||
|
| `np.int16` | `torch.ShortTensor` |
|
||||||
|
| `np.int32` | `torch.IntTensor` |
|
||||||
|
| `np.int64` | `torch.LongTensor` |
|
||||||
|
|
||||||
## Constructors
|
## Constructors
|
||||||
|
|
||||||
|
|||||||
+10
-6
@@ -1,14 +1,18 @@
|
|||||||
types:
|
types:
|
||||||
- numpy: np.uint8
|
|
||||||
pytorch: torch.ByteTensor
|
|
||||||
- numpy: np.int32
|
|
||||||
pytorch: torch.IntTensor
|
|
||||||
- numpy: np.int64
|
|
||||||
pytorch: torch.LongTensor
|
|
||||||
- numpy: np.float32
|
- numpy: np.float32
|
||||||
pytorch: torch.FloatTensor
|
pytorch: torch.FloatTensor
|
||||||
- numpy: np.float64
|
- numpy: np.float64
|
||||||
pytorch: torch.DoubleTensor
|
pytorch: torch.DoubleTensor
|
||||||
|
- numpy: np.int8
|
||||||
|
pytorch: torch.CharTensor
|
||||||
|
- numpy: np.uint8
|
||||||
|
pytorch: torch.ByteTensor
|
||||||
|
- numpy: np.int16
|
||||||
|
pytorch: torch.ShortTensor
|
||||||
|
- numpy: np.int32
|
||||||
|
pytorch: torch.IntTensor
|
||||||
|
- numpy: np.int64
|
||||||
|
pytorch: torch.LongTensor
|
||||||
|
|
||||||
constructors:
|
constructors:
|
||||||
- numpy: np.empty((2, 3))
|
- numpy: np.empty((2, 3))
|
||||||
|
|||||||
Reference in New Issue
Block a user