Merge pull request #913 from ground0state/master

Fix bugs that Mixup does not work when device is cpu
This commit is contained in:
Ross Wightman 2021-10-12 14:09:56 -07:00 committed by GitHub
commit 2c33ca6d8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -214,7 +214,7 @@ class Mixup:
lam = self._mix_pair(x)
else:
lam = self._mix_batch(x)
target = mixup_target(target, self.num_classes, lam, self.label_smoothing)
target = mixup_target(target, self.num_classes, lam, self.label_smoothing, x.device)
return x, target