How to identify the in-place operation in pytorch?

You can use torch.autograd.set_detect_anomaly(True).