diff --git a/benchmarks/other/sporco/admm/admm.py b/benchmarks/other/sporco/admm/admm.py index e363ce01..8050e4e5 100644 --- a/benchmarks/other/sporco/admm/admm.py +++ b/benchmarks/other/sporco/admm/admm.py @@ -235,7 +235,7 @@ def __init__(self, Nx, yshape, ushape, dtype, opt=None): self.Nx = Nx # Working variable U has the same dimensionality as constant c # in the constraint Ax + By = c - self.Nc = np.product(np.array(ushape)) + self.Nc = np.prod(np.array(ushape)) # DataType option overrides data type inferred from __init__ # parameters of derived class @@ -861,7 +861,7 @@ def __init__(self, xshape, dtype, opt=None): if opt is None: opt = ADMMEqual.Options() - Nx = np.product(np.array(xshape)) + Nx = np.prod(np.array(xshape)) super(ADMMEqual, self).__init__(Nx, xshape, xshape, dtype, opt) diff --git a/benchmarks/other/sporco/admm/parcbpdn.py b/benchmarks/other/sporco/admm/parcbpdn.py index 87f72152..46872486 100644 --- a/benchmarks/other/sporco/admm/parcbpdn.py +++ b/benchmarks/other/sporco/admm/parcbpdn.py @@ -103,7 +103,7 @@ def mpraw_as_np(shape, dtype): Numpy array """ - sz = int(np.product(shape)) + sz = int(np.prod(shape)) csz = sz * np.dtype(dtype).itemsize raw = mp.RawArray('c', csz) return np.frombuffer(raw, dtype=dtype, count=sz).reshape(shape) diff --git a/benchmarks/other/sporco/dictlrn/prlcnscdl.py b/benchmarks/other/sporco/dictlrn/prlcnscdl.py index 985e12d0..d205d46c 100644 --- a/benchmarks/other/sporco/dictlrn/prlcnscdl.py +++ b/benchmarks/other/sporco/dictlrn/prlcnscdl.py @@ -110,7 +110,7 @@ def mpraw_as_np(shape, dtype): Numpy array """ - sz = int(np.product(shape)) + sz = int(np.prod(shape)) csz = sz * np.dtype(dtype).itemsize raw = mp.RawArray('c', csz) return np.frombuffer(raw, dtype=dtype, count=sz).reshape(shape) diff --git a/benchmarks/other/sporco/prox.py b/benchmarks/other/sporco/prox.py index 649afbad..40dfc9d1 100644 --- a/benchmarks/other/sporco/prox.py +++ b/benchmarks/other/sporco/prox.py @@ -112,7 +112,7 @@ def ndto2d(x, axis=-1): # Reshape into a 2D array with the axes specified by the axis # parameter flattened into an index along rows, and the remaining # axes flattened into an index aalong the columns - xtr = xt.reshape((np.product(xts[0:len(caxis)]), -1)) + xtr = xt.reshape((np.prod(xts[0:len(caxis)]), -1)) # Return reshaped array and a tuple containing the information # necessary to undo the entire operation return xtr, (xts, prm) diff --git a/dicodile/utils/dictionary.py b/dicodile/utils/dictionary.py index a169a8db..156ed125 100644 --- a/dicodile/utils/dictionary.py +++ b/dicodile/utils/dictionary.py @@ -116,7 +116,7 @@ def init_dictionary(X, n_atoms, atom_support, random_state=None): X_std = X.std() n_channels, *sig_support = X.shape valid_support = get_valid_support(sig_support, atom_support) - n_patches = np.product(valid_support) + n_patches = np.prod(valid_support) indices = iter(rng.choice(n_patches, size=10 * n_atoms, replace=False)) D = np.empty(shape=(n_atoms, n_channels, *atom_support))