refactor: remove if-condition

pull/1105/head
kozistr 2022-01-21 14:19:11 +09:00
parent 499c4749d7
commit 56a6b38f76
1 changed files with 1 additions and 4 deletions

View File

@ -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(