Open xywei opened 3 years ago
Ultimately, if we were to treat sparse arrays as normal ones, we likely wouldn't need an analog of apply_along_axis
, as the expressions could just be evaluated on the sparse entries of the array. At first, only "sparsity-preserving" operations would/should be allowed, i.e. anything that changes the sparsity pattern would have to be disallowed, implicitly or in a verified manner. Then we could look into reductions over sparse axes, which would at least give us SPMV.
@inducer @kaushikcfd As discussed earlier today, the motivation is to extend the syntax to support batching across a sparse array.
For example, given an expression for per-box map (I am using python syntax to represent expression IOs):
A "CSR batching" here means applying the per-box map to a list of boxes with inhomogeneous point counts, which does the equivalent of the following:
Note that
start, stop, _n_box_points
needs to be special placeholders in order to handle data-dependency.@kaushikcfd also suggested a more general interface by supplying CSR arrays similar interface to normal arrays, and add the equivalence of
numpy.apply_along_axis
support for arrays.