@[TOC]内存释放] python test before = id(Y) Y = X + Y id(Y) == before 结果 False 方法 Z = torch.zeros_like(Y) Z[:] = X + Y