set_order#
- rateslib.dual.set_order(val, order)#
Changes the order of a
DualorDual2and 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
orderis zero, all objects are converted to float.If
orderis one, Dual2 are converted to Dual by dropping second order gradients.If
orderis two, Dual are converted to DUal2 by setting second order gradients to default zero values.