Created by: guomingz
The previous implementation on save_inference_model will remove the op unexpectedly due to improper list operation. My fixing will fix this corner case.
I found the previous PR(14547) still hang(or blocked) on pre_ci_mac, please close that thread. So i re-fork the paddle again and apply the fixing to avoid unnecessary merge.