YDOOK:Pytorch教程:反向传播 out.backward() 用法
YDOOK:Pytorch教程:反向传播 out.backward() 用法
© YDOOK Jinwei Lin, shiye.work
文章目录
YDOOK:Pytorch教程:反向传播 out.backward() 用法© YDOOK Jinwei Lin, shiye.workCode:Outcome:
Code:
import numpy
import torch
import numpy as np
# a = torch.tensor([1], requires_grad=True, dtype=torch.float)
#反向传播
x = torch.ones(2, 2, requires_grad=True)
print('x = ', x)
print()
y = torch.ones(2, 2, requires_grad=True)
print('y
共有 0 条评论