Skip to content

Commit 2a89491

Browse files
authored
Set model parameters to requires_grad=False (#3272)
* Set model parameters to requires_grad=False Disable gradient computation for model parameters to fix test failing after pytorch/pytorch#166367 * Fix formatting of requires_grad assignment
1 parent 315e9b4 commit 2a89491

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/sparsity/test_marlin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def setUp(self):
3939
.half()
4040
.cuda()
4141
)
42+
for param in self.model.parameters():
43+
param.requires_grad = False
4244

4345
@pytest.mark.skipif(not torch.cuda.is_available(), reason="Need CUDA available")
4446
@skip_if_rocm("ROCm enablement in progress")

0 commit comments

Comments
 (0)