Skip to content

Commit 5fc72cb

Browse files
committed
Use np.prod instead of np.product
1 parent de9a346 commit 5fc72cb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/estimagic/parameters/block_trees.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def matrix_to_block_tree(matrix, outer_tree, inner_tree):
3737
shapes_outer = [np.shape(a) for a in flat_outer_np]
3838
shapes_inner = [np.shape(a) for a in flat_inner_np]
3939

40-
block_bounds_outer = np.cumsum([int(np.product(s)) for s in shapes_outer[:-1]])
41-
block_bounds_inner = np.cumsum([int(np.product(s)) for s in shapes_inner[:-1]])
40+
block_bounds_outer = np.cumsum([int(np.prod(s)) for s in shapes_outer[:-1]])
41+
block_bounds_inner = np.cumsum([int(np.prod(s)) for s in shapes_inner[:-1]])
4242

4343
blocks = []
4444
for leaf_outer, s1, submat in zip(
@@ -94,8 +94,8 @@ def hessian_to_block_tree(hessian, f_tree, params_tree):
9494
shapes_f = [np.shape(a) for a in flat_f_np]
9595
shapes_p = [np.shape(a) for a in flat_p_np]
9696

97-
block_bounds_f = np.cumsum([int(np.product(s)) for s in shapes_f[:-1]])
98-
block_bounds_p = np.cumsum([int(np.product(s)) for s in shapes_p[:-1]])
97+
block_bounds_f = np.cumsum([int(np.prod(s)) for s in shapes_f[:-1]])
98+
block_bounds_p = np.cumsum([int(np.prod(s)) for s in shapes_p[:-1]])
9999

100100
sub_block_trees = []
101101
for s0, subarr in zip(shapes_f, np.split(hessian, block_bounds_f, axis=0)):

0 commit comments

Comments
 (0)