qimpy.algorithms.Gradable
- class Gradable
Bases:
ABC
,Generic
[GradientType
]Interface to store gradient w.r.t current object, analogous to pytorch.
- __init__()
- Return type:
None
Methods
Set whether gradient with respect to this object is needed.
zeros_like
Attributes
Return whether gradient with respect to this object is needed.
optional gradient (of energy) with respect to this object.
- requires_grad_(requires_grad=True, clear=False)
Set whether gradient with respect to this object is needed. If clear, also clear previous gradient / set to zero as needed.
- Parameters:
requires_grad (bool) –
clear (bool) –
- Return type:
None
- grad: GradientType
optional gradient (of energy) with respect to this object.
- property requires_grad: bool
Return whether gradient with respect to this object is needed.