Parameter — PyTorch 1.10.1 documentation
pytorch.org › torchParameter¶ class torch.nn.parameter. Parameter (data = None, requires_grad = True) [source] ¶. A kind of Tensor that is to be considered a module parameter. Parameters are Tensor subclasses, that have a very special property when used with Module s - when they’re assigned as Module attributes they are automatically added to the list of its parameters, and will appear e.g. in parameters ...
Adding new parameters - PyTorch Forums
discuss.pytorch.org › t › adding-new-parametersFeb 10, 2018 · I’d like to add a new Parameter to my network. I have successfully created one, incorporated it into forward() and have a grad calcualted in backward(). However when I apply optimizer.step() the grad is not applied. Searching through here I have seen the register_parameter() function. This adds the parameter to my network’s _parameters, but not to its named_parameters which seems to be ...