From 56a6b38f76783d53a898e4125aeabaf1d0f700d4 Mon Sep 17 00:00:00 2001 From: kozistr Date: Fri, 21 Jan 2022 14:19:11 +0900 Subject: [PATCH] refactor: remove if-condition --- benchmark.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/benchmark.py b/benchmark.py index 17c095a8..5e07e5fe 100755 --- a/benchmark.py +++ b/benchmark.py @@ -310,10 +310,7 @@ class TrainBenchmarkRunner(BenchmarkRunner): super().__init__(model_name=model_name, device=device, torchscript=torchscript, **kwargs) self.model.train() - if kwargs.pop('smoothing', 0) > 0: - self.loss = nn.CrossEntropyLoss().to(self.device) - else: - self.loss = nn.CrossEntropyLoss().to(self.device) + self.loss = nn.CrossEntropyLoss().to(self.device) self.target_shape = tuple() self.optimizer = create_optimizer_v2(