Merge pull request #913 from ground0state/master

Fix bugs that Mixup does not work when device is cpu
pull/914/head
Ross Wightman 3 years ago committed by GitHub
commit 2c33ca6d8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -214,7 +214,7 @@ class Mixup:
lam = self._mix_pair(x) lam = self._mix_pair(x)
else: else:
lam = self._mix_batch(x) 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 return x, target

Loading…
Cancel
Save