Is nn.utils.vector_to_parameters() not differentiable?

This method uses the .data attribute internally:

param.data = vec[pointer:pointer + num_param].view_as(param).data

and thus Autograd won’t capture this operation.
You could check if e.g. torch.nn.utils.parametrize might work as described in this post.

2 Likes