Shortcuts

torch.Tensor.retain_grad

Tensor.retain_grad() None

使此张量能够在执行backward()期间填充其grad。对于叶子张量,这是一个无操作。

优云智算