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()
iterator. Assigning a Tensor doesn’t have such effect. This is because one might want to cache some temporary state, like last hidden state of the RNN, in the model. If there was no such class as Parameter
, these temporaries would get registered too.
data (Tensor) – parameter tensor.
requires_grad (bool, optional) – if the parameter requires gradient. Note that the torch.no_grad() context does NOT affect the default behavior of Parameter creation–the Parameter will still have requires_grad=True in no_grad
mode. See Locally disabling gradient computation for more details. Default: True
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4