PyTorch中 tensor.detach() 和 tensor.data 的区别详解 PyTorch0.4中,.data仍保留,但建议使用.detach(),区别在于.data返回和x的相同数据tensor,但不会加 tensor.data