Remove unused dict values in items() with values() (#18651)

Signed-off-by: Kayzwer <68285002+Kayzwer@users.noreply.github.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Kayzwer 2025-01-15 20:52:26 +08:00 committed by GitHub
parent 031954d243
commit 2af30654f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -140,7 +140,7 @@ class Tuner:
# Mutate # Mutate
r = np.random # method r = np.random # method
r.seed(int(time.time())) r.seed(int(time.time()))
g = np.array([v[2] if len(v) == 3 else 1.0 for k, v in self.space.items()]) # gains 0-1 g = np.array([v[2] if len(v) == 3 else 1.0 for v in self.space.values()]) # gains 0-1
ng = len(self.space) ng = len(self.space)
v = np.ones(ng) v = np.ones(ng)
while all(v == 1): # mutate until a change occurs (prevent duplicates) while all(v == 1): # mutate until a change occurs (prevent duplicates)