Skip to content

Commit 72e66c1

Browse files
authored
Merge pull request #1076 from Trusted-AI/development_issue_1073
Add missing to device transfer
2 parents c0ecd91 + 8581c6c commit 72e66c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

art/attacks/evasion/projected_gradient_descent/projected_gradient_descent_pytorch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def _compute_perturbation( # pylint: disable=W0221
293293

294294
# Apply mask
295295
if mask is not None:
296-
grad = torch.where(mask == 0.0, torch.tensor(0.0), grad)
296+
grad = torch.where(mask == 0.0, torch.tensor(0.0).to(self.estimator.device), grad)
297297

298298
# Apply norm bound
299299
if self.norm in ["inf", np.inf]:

0 commit comments

Comments
 (0)