can i use something internally so that the gradient is not computed by itself
i tried using
        new_test_model.conv1.weight[0].requires_grad = False
but got

RuntimeError: you can only change requires_grad flags of leaf variables. If you want to use a computed variable in a subgraph that doesn’t require differentiation use var_no_grad = var.detach().

Then I tried using
        new_test_model.conv1.weight[0] = new_test_model.conv1.weight[0].detach()
but then I am getting

Screenshot (275)1380×723 23.9 KB