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: README.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,11 @@
8
8
Python bindings for the [xtensor](https://github.com/QuantStack/xtensor) C++ multi-dimensional array library.
9
9
10
10
-`xtensor` is a C++ library for multi-dimensional arrays enabling numpy-style broadcasting and lazy computing.
11
-
-`xtensor-python` enables inplace use of numpy arrays with all the benefits from `xtensor`
11
+
-`xtensor-python` enables inplace use of numpy arrays in C++ with all the benefits from `xtensor`
12
12
13
13
- C++ universal function and broadcasting
14
14
- STL - compliant APIs.
15
+
- A broad coverage of numpy APIs (see [the numpy to xtensor cheat sheet](http://xtensor.readthedocs.io/en/latest/numpy.html)).
15
16
16
17
The Python bindings for `xtensor` are based on the [pybind11](https://github.com/pybind/pybind11/) C++ library, which enables seemless interoperability between C++ and Python.
17
18
@@ -42,6 +43,18 @@ These dependencies are automatically resolved when using the conda package manag
42
43
43
44
## Usage
44
45
46
+
xtensor-python offers two container types wrapping numpy arrays inplace to provide an xtensor semantics
47
+
48
+
-``pytensor``
49
+
-``pyarray``.
50
+
51
+
Both containers enable the numpy-style APIs of xtensor (see [the numpy to xtensor cheat sheet](http://xtensor.readthedocs.io/en/latest/numpy.html)).
52
+
53
+
- On the one hand, ``pyarray`` has a dynamic number of dimensions. Just like numpy arrays, it can be reshaped with a shape of a different length (and the new shape is reflected on the python side).
54
+
55
+
- On the other hand ``pytensor`` has a compile time number of dimensions, specified with a template parameter. Shapes of ``pytensor`` instances are stack allocated, making ``pytensor`` a significantly
56
+
faster expression than ``pyarray``.
57
+
45
58
### Example 1: Use an algorithm of the C++ library on a numpy array inplace.
0 commit comments