mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
refactor: remove if-condition
This commit is contained in:
parent
499c4749d7
commit
56a6b38f76
@ -310,9 +310,6 @@ class TrainBenchmarkRunner(BenchmarkRunner):
|
|||||||
super().__init__(model_name=model_name, device=device, torchscript=torchscript, **kwargs)
|
super().__init__(model_name=model_name, device=device, torchscript=torchscript, **kwargs)
|
||||||
self.model.train()
|
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.target_shape = tuple()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user