You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing the docs, it would be nice to follow jax's lead and include a TL;DR of what sorts of operations are supported. From their docs:
TLDR Do use
Functional programming
Many of NumPy’s functions (help us add more!)
Some SciPy functions
Indexing and slicing of arrays like x = A[[5, 1, 7], :, 2:4]
Explicit array creation from lists like A = np.array([x, y])
Don’t use
Assignment into arrays like A[0, 0] = x
Implicit casting to arrays like np.sum([x, y]) (use np.sum(np.array([x, y]) instead)
A.dot(B) method syntax for functions of more than one argument (use np.dot(A, B) instead)
Side-effects like mutation of arguments or mutation of global variables
The out argument of NumPy functions
Dtype casting like np.float64(x) (use x.astype('float64') or x.astype(np.float64) instead).
For jit functions, also don’t use
Control flow based on dynamic values if x > 0: .... Control flow based on shapes is fine: if x.shape[0] > 2: ... and for subarr in array.
Slicing A[i:i+5] for dynamic index i (use lax.dynamic_slice instead) or boolean indexing A[bool_ind] for traced values bool_ind.
The text was updated successfully, but these errors were encountered:
This should be pretty easy for us since the only thing you can't do is assignment into arrays (yet – #75). Some general docs and usage tips are definitely a good idea though.
This should be pretty easy for us since the only thing you can't do is assignment into arrays (yet – #75). Some general docs and usage tips are definitely a good idea though.
Yup, just remembered that when investigating that issue :) I'm hoping that's an easy fix though, whereas the mutation restriction will probably be part of a stable release.
When writing the docs, it would be nice to follow jax's lead and include a TL;DR of what sorts of operations are supported. From their docs:
The text was updated successfully, but these errors were encountered: