From 0833d10e9171a0c9b4adbb59ef228d60fa107418 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Tue, 8 Oct 2024 18:50:50 +0200 Subject: [PATCH] Numpy 2.0 compatibility (#42) Fixes `AttributeError: module 'numpy' has no attribute 'product'` --- tests/test_derivative.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_derivative.py b/tests/test_derivative.py index 8f09222..e5ab637 100644 --- a/tests/test_derivative.py +++ b/tests/test_derivative.py @@ -16,14 +16,14 @@ def rosenbrock(input_value, output_shape): - size = np.product(output_shape) + size = np.prod(output_shape) values = [rosen(input_value + i * 0.01) for i in range(size)] output = np.array(values).reshape(output_shape) return output def rosenbrock_der(input_value, output_shape): - size = np.product(output_shape) + size = np.prod(output_shape) input_shape = input_value.shape values = [rosen_der(input_value + i * 0.01) for i in range(size)] # The input shape is the "deepest" dimension(s), i.e. expect