From e0c409035f0d302483b480a92ac555c5ee30c7fe Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Mon, 12 Oct 2026 05:38:19 -0700 Subject: [PATCH] Replace `# pytype: disable` suppressions with `# pyrefly: ignore` PiperOrigin-RevId: 997860089 --- .../privacy/privacy_tests/epsilon_lower_bound.py | 4 ++-- .../privacy_tests/membership_inference_attack/seq2seq_mia.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tensorflow_privacy/privacy/privacy_tests/epsilon_lower_bound.py b/tensorflow_privacy/privacy/privacy_tests/epsilon_lower_bound.py index 1684ec28..28240dfc 100644 --- a/tensorflow_privacy/privacy/privacy_tests/epsilon_lower_bound.py +++ b/tensorflow_privacy/privacy/privacy_tests/epsilon_lower_bound.py @@ -50,12 +50,12 @@ def _get_tp_fp_for_thresholds(pos_scores: np.ndarray, y_score = np.concatenate([pos_scores, neg_scores]) try: # sklearn 1.8.0 or newer - _, fp, _, tp, _ = sklearn.metrics.confusion_matrix_at_thresholds( # pytype:disable=module-attr + _, fp, _, tp, _ = sklearn.metrics.confusion_matrix_at_thresholds( y_true=y_true, y_score=y_score ) except AttributeError: # sklearn 1.7.2 or older - fp, tp, _ = sklearn.metrics._ranking._binary_clf_curve( # pylint:disable=protected-access # pytype:disable=module-attr + fp, tp, _ = sklearn.metrics._ranking._binary_clf_curve( # pylint:disable=protected-access # pyrefly: ignore[missing-attribute] y_true=y_true, y_score=y_score ) return tp, fp diff --git a/tensorflow_privacy/privacy/privacy_tests/membership_inference_attack/seq2seq_mia.py b/tensorflow_privacy/privacy/privacy_tests/membership_inference_attack/seq2seq_mia.py index 3512b049..6b4a726a 100644 --- a/tensorflow_privacy/privacy/privacy_tests/membership_inference_attack/seq2seq_mia.py +++ b/tensorflow_privacy/privacy/privacy_tests/membership_inference_attack/seq2seq_mia.py @@ -227,7 +227,7 @@ def _get_batch_loss_metrics(batch_logits: np.ndarray, if not tf.executing_eagerly(): session = tf.compat.v1.Session() - batch_loss = batch_loss.eval(session) # pytype: disable=attribute-error + batch_loss = batch_loss.eval(session) # pyrefly: ignore[missing-attribute] return batch_loss / batch_length, batch_length @@ -255,7 +255,7 @@ def _get_batch_accuracy_metrics( if not tf.executing_eagerly(): session = tf.compat.v1.Session() - batch_correct_preds = batch_correct_preds.eval(session) # pytype: disable=attribute-error + batch_correct_preds = batch_correct_preds.eval(session) # pyrefly: ignore[missing-attribute] return batch_correct_preds, batch_total_preds