1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""Type stubs for scirs2 parallel batch-processing functions."""
"""Compute the arithmetic mean of each sub-array in parallel.
The GIL is released during Rayon computation, allowing Python threads to
run concurrently. Empty sub-arrays return ``0.0``.
Args:
arrays: A list of float arrays. One mean value is produced per element.
Returns:
A list of ``float`` mean values with the same length as *arrays*.
"""
...
"""Batch matrix-vector multiplication in parallel.
Each pair ``(matrices[i], vectors[i])`` computes ``A * v`` where ``A`` is
stored in row-major order with shape ``(n_rows, n_cols)`` and ``v`` has
length ``n_cols``. The GIL is released during Rayon computation.
Args:
matrices: List of flat row-major matrices, each with
``n_rows * n_cols`` elements.
vectors: List of vectors, each with ``n_cols`` elements.
n_rows: Number of rows in each matrix.
n_cols: Number of columns in each matrix (equals length of each vector).
Returns:
A list of result vectors, each of length ``n_rows``.
Raises:
ValueError: If *matrices* and *vectors* have different lengths, or if
any matrix/vector has the wrong number of elements.
"""
...