torch.no_grad() will make sure that the operations inside the block are not tracked by Autograd and thus not recorded in the computation graph (as you don’t want to backpropagate through the parameter assignment).
The nn.Parameter itself should keep its requires_grad=True attribute.