If you just want to find in-place operations, maybe you can look for operations ends with underscore _. For instance, ‘inputs.masked_fill_( input_mask, 3 )’ in your case. Or more general, to consult with official doc: https://pytorch.org/docs/master/tensors.html 259 to see if there is any returns from the operator.