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
Copy file name to clipboardExpand all lines: spec/use_cases.md
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -143,3 +143,32 @@ Hence the complete `einops` code base could be close to 50% smaller, and easier
143
143
[Unumpy](https://github.com/Quansight-Labs/unumpy) and
144
144
[EagerPy](https://github.com/jonasrauber/eagerpy). Many end users and organizations will also have such glue code - it tends to be needed whenever one tries to support multiple
145
145
array types in a single API.
146
+
147
+
148
+
### Use case 3: adding a Python API to xtensor
149
+
150
+
[xtensor](https://github.com/xtensor-stack/xtensor) is a C++ array library
151
+
that is NumPy-inspired and provides lazy arrays. It has Python (and Julia and R)
152
+
bindings, however it does not have a Python array API.
153
+
154
+
Xtensor aims to follow NumPy closely, however it only implements a subset of functionality
155
+
and documents some API differences in
156
+
[Notable differences with NumPy](https://xtensor.readthedocs.io/en/latest/numpy-differences.html).
157
+
158
+
Note that other libraries document similar differences, see for example
159
+
[this page for JAX](https://jax.readthedocs.io/en/latest/jax.numpy.html) and
160
+
[this page for TensorFlow](https://www.tensorflow.org/guide/tf_numpy).
161
+
162
+
Each time an array library author designs a new API, they have to choose (a)
163
+
what subset of NumPy makes sense to implement, and (b) where to deviate
164
+
because NumPy's API for a particular function is suboptimal or the semantics
165
+
don't fit their execution model.
166
+
167
+
This array API standard aims to provide an API that can be readily adopted,
168
+
without having to make the above-mentioned choices.
169
+
170
+
.. note::
171
+
172
+
XND is another array library, written in C, that still needs a Python API.
173
+
Array implementations in other languages are often in a similar situation,
174
+
and could translate this array API standard 1:1 to their language.
0 commit comments