PyTorch0.4 中 backward()

retain_variables报错,替换成retain_graph

            L_img.backward(retain_graph=True) # in case of current version of pytorch
#            L_img.backward(retain_variables=True)

你可能感兴趣的:(torch,pytorch学习)