torch._foreach_zero_(self)
Paddle 无此 API,需要组合实现。
# PyTorch 写法 torch._foreach_zero_(tensors) # Paddle 写法 [x.zero_() for x in tensors]