From 04bbe7fde40b1b48e5d41e3a0c0982ac508ef5db Mon Sep 17 00:00:00 2001 From: Cheng Gong Date: Fri, 25 Oct 2024 20:36:30 -0400 Subject: [PATCH] change np.Inf to np.inf for numpy>2.0 (#1863) --- deepxde/callbacks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deepxde/callbacks.py b/deepxde/callbacks.py index 65710354c..63c5961b5 100644 --- a/deepxde/callbacks.py +++ b/deepxde/callbacks.py @@ -137,7 +137,7 @@ def __init__( self.monitor = monitor self.monitor_op = np.less self.epochs_since_last_save = 0 - self.best = np.Inf + self.best = np.inf def on_epoch_end(self): self.epochs_since_last_save += 1 @@ -221,7 +221,7 @@ def on_train_begin(self): if self.baseline is not None: self.best = self.baseline else: - self.best = np.Inf if self.monitor_op == np.less else -np.Inf + self.best = np.inf if self.monitor_op == np.less else -np.inf def on_epoch_end(self): if self.model.train_state.epoch < self.start_from_epoch: