IntelLabs / numba

NumPy aware dynamic Python compiler using LLVM
http://numba.pydata.org/
BSD 2-Clause "Simplified" License
12 stars 2 forks source link

Refactor array analysis to insert runtime assertions (or: adhere to broadcast semantics) #20

Closed ninegua closed 7 years ago

ninegua commented 7 years ago

Related discussion numba/numba#2399

The proposed plan is to divide array analysis into two parts:

  1. Insert assertions at places where broadcast rules would apply;

  2. Array size equivalences would then look at assertions, removing those that can be derived from "previous" ones, and building equivalence classes along the way.

At the end of the process, residual assertions become dynamic checks that would throw error if condition doesn't match.

ninegua commented 7 years ago

Implemented in numba/numba#2492.