From 1235e1e1136b6a066e26a5011f3de42bf7dd19c0 Mon Sep 17 00:00:00 2001 From: Huanyu Zhang Date: Thu, 27 Jun 2024 14:33:08 -0700 Subject: [PATCH] Fix the doctest due to numpy 2.0 (#654) Summary: Pull Request resolved: https://github.com/pytorch/opacus/pull/654 Doctest fails due to numpy's upgrade into 2.0, which changes the way of printing. https://github.com/astropy/astropy/issues/15095 Reviewed By: EnayatUllah Differential Revision: D58873298 fbshipit-source-id: 5c4a21ff590c70b9643a1d921bc32b258e215616 --- opacus/accountants/analysis/rdp.py | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opacus/accountants/analysis/rdp.py b/opacus/accountants/analysis/rdp.py index c83dc05f..0106cbee 100644 --- a/opacus/accountants/analysis/rdp.py +++ b/opacus/accountants/analysis/rdp.py @@ -39,7 +39,7 @@ ... rdp += compute_rdp(q=q, noise_multiplier=sigma, steps=steps, orders=orders) >>> epsilon, opt_order = get_privacy_spent(orders=orders, rdp=rdp, delta=1e-5) - >>> epsilon, opt_order # doctest: +NUMBER + >>> float(epsilon), int(opt_order) # doctest: +NUMBER (0.336, 23) """ diff --git a/requirements.txt b/requirements.txt index 7a591a56..a114129f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -numpy>=1.15 +numpy>=1.15,<2.0 torch>=2.0 scipy>=1.2 opt-einsum>=3.3.0