From bf7c930aed187ecc43f6776f4ac9623a7bee3ba9 Mon Sep 17 00:00:00 2001 From: hrntsm Date: Sun, 26 Nov 2023 17:43:05 +0900 Subject: [PATCH] Add dtype to randint --- optuna_dashboard/preferential/samplers/gp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/optuna_dashboard/preferential/samplers/gp.py b/optuna_dashboard/preferential/samplers/gp.py index 3cd980614..590c55701 100644 --- a/optuna_dashboard/preferential/samplers/gp.py +++ b/optuna_dashboard/preferential/samplers/gp.py @@ -317,7 +317,7 @@ def __init__( self._rng = np.random.RandomState(seed) self.independent_sampler = independent_sampler or optuna.samplers.RandomSampler( - seed=self._rng.randint(2**32) + seed=self._rng.randint(2**32, dtype=np.int64) ) self._search_space = optuna.search_space.IntersectionSearchSpace() @@ -355,7 +355,7 @@ def sample_relative( ) pref_ids = torch.tensor([[ids[b], ids[w]] for b, w in preferences], dtype=torch.int32) with torch.random.fork_rng(): - torch.manual_seed(self._rng.randint(2**32)) + torch.manual_seed(self._rng.randint(2**32, dtype=np.int64)) self._gp = self._gp or _PreferentialGP( kernel=self.kernel