Skip to content

Commit 3f14834

Browse files
committed
Review comments
1 parent 9b01c7d commit 3f14834

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

spec/draft/migration_guide.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,15 @@ how to use it.
244244

245245
### NumPy
246246

247+
Please note that `xp` is a convention for the array namespace variable, but all
248+
the alternatives provided in the tables below can be used with the original `np`
249+
name as well.
250+
251+
```py
252+
import numpy as np
253+
xp = np
254+
```
255+
247256
| NumPy API | Array API | Notes |
248257
| --- | --- | --- |
249258
| `np.transpose(x, axes)` | `xp.permute_dims(x, axes)` | `None` is not supported |
@@ -285,6 +294,14 @@ how to use it.
285294

286295
### PyTorch
287296

297+
For PyTorch, we use `array-api-compat` for the transition, so it's a required
298+
dependency for the migration process. You can import it as follows:
299+
300+
```py
301+
import array_api_compat.torch as torch
302+
xp = torch
303+
```
304+
288305
| PyTorch API | Array API | Notes |
289306
| --- | --- | --- |
290307
| `torch.transpose(x, dim0, dim1)` | `xp.permute_dims(x, axes)` | |

0 commit comments

Comments
 (0)