Skip to content

Commit 2a73808

Browse files
committed
Fix grad assignment
1 parent 5434d5d commit 2a73808

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/attr/layer/test_grad_cam.py

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def test_simple_input_conv_without_final_relu(self) -> None:
5858
def test_simple_input_conv_fc_with_final_relu(self) -> None:
5959
net = BasicModel_ConvNet_One_Conv()
6060
inp = torch.arange(16).view(1, 1, 4, 4).float()
61-
inp.requires_grad_()
6261
# Adding negative value to test final relu is applied
6362
inp[0, 0, 1, 1] = -4.0
63+
inp.requires_grad_()
6464
exp = 0.5625 * inp
6565
exp[0, 0, 1, 1] = 0.0
6666
self._grad_cam_test_assert(

0 commit comments

Comments
 (0)