Solved by tom in post #2 
              
              
                If you do this for an intermediate, you should multiply with a mask rather than assigning to the value. Quite likely the operation that generated the non-pruned output wants it to compute the backwards. (Search for “inplace” in the forums.) 
Best regards 
Thomas