set_order#
- rateslib.dual.set_order(val, order)#
Changes the order of a
Dual
orDual2
and a sets aVariable
.- Parameters:
- Return type:
Notes
floats are not affected by this function. There is no benefit to converting one of these types to a dual number type with no tagged variable sensitivity.
If
order
is zero, all objects are converted to float.If
order
is one, Dual2 are converted to Dual by dropping second order gradients.If
order
is two, Dual are converted to DUal2 by setting second order gradients to default zero values.