【pytorch】tensor的复制避坑;tensor.clone() & tensor.detach() 详解

目录

  • 最保险的办法:
  • 1 tensor.clone()
  • 2 tensor.detach()

问题来源:

a = torch.zeros(2, 3)
for i in range(2):
    for j in range

你可能感兴趣的:(pytorch入门到精通,pytorch,python,深度学习)