hxtorch.spiking.modules.sparse_synapse.Parameter
-
class
hxtorch.spiking.modules.sparse_synapse.
Parameter
(data=None, requires_grad=True) Bases:
torch.Tensor
A kind of Tensor that is to be considered a module parameter.
Parameters are
Tensor
subclasses, that have a very special property when used withModule
s - when they’re assigned as Module attributes they are automatically added to the list of its parameters, and will appear e.g. inparameters()
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 asParameter
, these temporaries would get registered too.- Args:
data (Tensor): parameter tensor. requires_grad (bool, optional): if the parameter requires gradient. See
locally-disable-grad-doc for more details. Default: True
-
__init__
() Initialize self. See help(type(self)) for accurate signature.
Methods
Attributes