No… all .clone() calls you added are not needed. Instead you miss the only one that matters, cloning the input. So it would be something like inserting static_parameter = static_parameter.clone() at the beginning of the function.