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
{{ message }}
Repository navigation
np.product used in operators/ raises AttributeError on NumPy 2.0 #37
operators/common/Operator.py and operators/op_reconstruction/GRU.py call np.product(shape). NumPy 2.0 removed np.product (see the NumPy 2.0 migration guide: "product" -> use np.prod instead).
Since requirements.txt pins numpy>="1.19.5" with no upper bound, a fresh pip install -r requirements.txt today installs NumPy 2.x, so this is reachable immediately.
Repro
Run the op reconstruction test suite (operators/test.py). Gather.py calls run_comparison(..., incremental_vals=True), which hits the np.product line in Operator.py:164 and raises:
AttributeError: module ''numpy'' has no attribute ''product''
Fix
Replace np.product with np.prod in:
operators/common/Operator.py
operators/op_reconstruction/GRU.py (same dead API, latent until incremental_vals=True is passed to its run_comparison override)
I have a one-line fix for both ready to submit as a PR.
Activity