Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Replace deprecated np.product by np.prod #2242

Merged
merged 2 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/examples/notebooks/pytorch_tests_onoff.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
" self.auxdata.append(bkg_over_bsq)\n",
"\n",
" def alphas(self, pars):\n",
" return np.product([pars, self.bkg_over_db_squared], axis=0)\n",
" return np.prod([pars, self.bkg_over_db_squared], axis=0)\n",
"\n",
" def logpdf(self, a, alpha):\n",
" return _log_poisson_impl(a, alpha)\n",
Expand Down
2 changes: 1 addition & 1 deletion src/pyhf/tensor/numpy_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def sum(self, tensor_in: Tensor[T], axis: int | None = None) -> ArrayLike:
return np.sum(tensor_in, axis=axis)

def product(self, tensor_in: Tensor[T], axis: Shape | None = None) -> ArrayLike:
return np.product(tensor_in, axis=axis) # type: ignore[arg-type]
return np.prod(tensor_in, axis=axis) # type: ignore[arg-type]

def abs(self, tensor: Tensor[T]) -> ArrayLike:
return np.abs(tensor)
Expand Down