uarray is a developer tool, it is not meant to be used directly by end-users.
This document is meant to elicit discussion from the broader community and to help
drive the direction that
uarray goes towards. Examples provided here may not be
This page describes the overall philosophy behind
uarray. For usage instructions,
uarray API documentation page. If you are interested in an augmentation
for NEP-22, please see the
uarray is a backend system for Python that allows you to separately define an API, along with backends that contain separate implementations of that API.
unumpy builds on top of uarray. It is an effort to specify the core NumPy API, and provide backends for the API.
What’s new in
uarray is, to our knowledge, the first backend-system for Python that’s generic
enough to cater to the use-cases of many libraries, while at the same time, being
unumpy is the first approach to leverage
uarray in order to build a
generic backend system for (what we hope will be) the core NumPy API. It will be
possible to create a backend object, and use that to perform operations. In addition,
it will be possible to change the used backend via a context manager.
Benefits for end users¶
End-users can easily take their code written for one backend and use it on another backend with a simple switch (using a Python context manager). This can have any number of effects, depending on the functionality of the library. For example:
For Matplotlib, changing styles of plots or producing different windows or image formats.
For Tensorly, providing a different computation backend that can be distributed or target the GPU or sparse arrays.
unumpy, it can do a similar thing: provide users with code they already wrote for numpy and easily switch to a different backend.
Relation to the NumPy duck-array ecosystem¶
uarray is a backend/dispatch mechanism with a focus on array computing and the
needs of the wider array community, by allowing a clean way to register an
implementation for any Python object (functions, classes, class methods, properties,
dtypes, …), it also provides an important building block for
It is meant to address the shortcomings of NEP-18 and NEP-13;
while still holding nothing in
uarray itself that’s specific to array computing
or the NumPy API.