This PR removes the general function.replace decorator and replaces it with the specialized deep_replace_property (used for simplified and optimized_for_numpy) and shallow_replace (used for replace_arguments, _deep_flatten_constants and _combine_loop_concatenates). The differences between the two constructs are as follows:
@deep_replace_property
property
intermediate values cached in object attribute
depth first
recursive
@shallow_replace
function
intermediate values cached only during replacement
This PR removes the general
function.replace decorator
and replaces it with the specializeddeep_replace_property
(used forsimplified
andoptimized_for_numpy
) andshallow_replace
(used forreplace_arguments
,_deep_flatten_constants
and_combine_loop_concatenates
). The differences between the two constructs are as follows:@deep_replace_property
@shallow_replace