Parameter contains tensors with data and gradients. Used to store trainable parameters of Model
.
data
- returns tensor with initial data.grad
- ifis_trainable == true
then attribute will contain the gradients computed and future calls tobackward()
will accumulate (add) gradients into it, otherwise grad is an empty tensor.train
- setis_trainable
totrue
.is_trainable
- istrue
if gradients need to be computed for thisTensor
, false otherwise.