From 3eb34d7b553ec3297f7e9ab02da50d7b9fec31dc Mon Sep 17 00:00:00 2001 From: Charlie Meyers Date: Wed, 29 Nov 2023 02:58:50 +0000 Subject: [PATCH] linting --- deckard/base/attack/attack.py | 2 +- deckard/base/model/model.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/deckard/base/attack/attack.py b/deckard/base/attack/attack.py index 45d8e9b0..654aaf4a 100644 --- a/deckard/base/attack/attack.py +++ b/deckard/base/attack/attack.py @@ -379,7 +379,7 @@ def __call__( end_timestamp = time() else: raise e - + time_dict.update( { "adv_fit_time_per_sample": (end - start) / (len(samples) * 1e9), diff --git a/deckard/base/model/model.py b/deckard/base/model/model.py index 3373d0a0..c9d240b2 100644 --- a/deckard/base/model/model.py +++ b/deckard/base/model/model.py @@ -179,6 +179,7 @@ def __call__(self, data: list, model: object, library=None): end_timestamp = time() elif "should be the same" in str(e).lower(): import torch + device = torch.device("cuda" if torch.cuda.is_available() else "cpu") data[0] = torch.from_numpy(data[0]) data[1] = torch.from_numpy(data[1])