autodiff.Dual.__eq__

Dual.__eq__(other)

Return element-wise (value and derivative vector) equality comparison of self and other.

Parameters
selfDual
otherint, float, Dual
Returns
outtuple

Examples

Dual number and scalar:

>>> ad.Dual(42) == 5
(False, array([False]))

Two dual numbers (univariate):

>>> ad.Dual(5, [2]) == ad.Dual(5, [1])
(True, array([False]))

Two dual numbers (multivariate):

>>> ad.Dual(2, [4, 2]) == ad.Dual(5, [1, 2])
(False, array([False,  True]))