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
- The ``size()`` method for containers now returns the total number of elements instead of the buffer size, which may differ when the smallest stride is greater than ``1``
Copy file name to clipboardExpand all lines: docs/source/expression.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,7 @@ Broadcasting
90
90
91
91
The number of dimensions of an :cpp:type:`xt::xexpression` and the sizes of these dimensions are provided by the :cpp:func:`~xt::xexpression::shape` method, which returns a sequence of unsigned integers
92
92
specifying the size of each dimension. We can operate on expressions of different shapes of dimensions in an elementwise fashion.
93
-
Broadcasting rules of *xtensor* are similar to those of Numpy_ and libdynd_.
93
+
Broadcasting rules of *xtensor* are similar to those of NumPy_ and libdynd_.
94
94
95
95
In an operation involving two arrays of different dimensions, the array with the lesser dimensions is broadcast across the leading dimensions of the other.
96
96
For example, if ``A`` has shape ``(2, 3)``, and ``B`` has shape ``(4, 2, 3)``, the result of a broadcast operation with ``A`` and ``B`` has shape ``(4, 2, 3)``.
Copy file name to clipboardExpand all lines: docs/source/numpy-differences.rst
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,12 +15,12 @@ xtensor and numpy are very different libraries in their internal semantics. Whil
15
15
is a lazy expression system, numpy manipulates in-memory containers, however, similarities in
16
16
APIs are obvious. See e.g. the numpy to xtensor cheat sheet.
17
17
18
-
And this page tracks the subtle differences of behavior between numpy and xtensor.
18
+
And this page tracks the subtle differences of behavior between NumPy and xtensor.
19
19
20
20
Zero-dimensional arrays
21
21
-----------------------
22
22
23
-
With numpy, 0-D arrays are nearly indistinguishable from scalars. This led to some issues w.r.t.
23
+
With NumPy, 0-D arrays are nearly indistinguishable from scalars. This led to some issues w.r.t.
24
24
universal functions returning scalars with 0-D array inputs instead of actual arrays...
25
25
26
26
In xtensor, 0-D expressions are not implicitly convertible to scalar values. Values held by 0-D
@@ -87,15 +87,15 @@ be assigned to a container such as xarray or xtensor.
87
87
Missing values
88
88
--------------
89
89
90
-
Support of missing values in numpy can be emulated with the masked array module,
90
+
Support of missing values in NumPy can be emulated with the masked array module,
91
91
which provides a means to handle arrays that have missing or invalid data.
92
92
93
93
Support of missing values in xtensor is done through a notion of optional values, implemented in ``xoptional<T, B>``, which serves both as a value type for container and as a reference proxy for optimized storage types. See the section of the documentation on :doc:`missing`.
94
94
95
95
Strides
96
96
-------
97
97
98
-
Strided containers of xtensor and numpy having the same exact memory layout may have different strides when accessing them through the ``strides`` attribute.
98
+
Strided containers of xtensor and NumPy having the same exact memory layout may have different strides when accessing them through the ``strides`` attribute.
99
99
The reason is an optimization in xtensor, which is to set the strides to ``0`` in dimensions of length ``1``, which simplifies the implementation of broadcasting of universal functions.
100
100
101
101
.. tip::
@@ -109,7 +109,7 @@ The reason is an optimization in xtensor, which is to set the strides to ``0`` i
0 commit comments