Skip to content

Commit e12a3ca

Browse files
authored
Merge branch 'dev_1.10.1' into development_issue_1630
2 parents 1112c8f + 77643d4 commit e12a3ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

art/attacks/evasion/adversarial_patch/adversarial_patch_pytorch.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,10 @@ def apply_patch(
683683
mask = mask.copy()
684684
mask = self._check_mask(mask=mask, x=x)
685685
x_tensor = torch.Tensor(x)
686-
mask_tensor = torch.Tensor(mask)
686+
if mask is not None:
687+
mask_tensor = torch.Tensor(mask)
688+
else:
689+
mask_tensor = None
687690
if isinstance(patch_external, np.ndarray):
688691
patch_tensor = torch.Tensor(patch_external)
689692
else:

0 commit comments

Comments
 (0)