摘要: 转自:https://www.cnblogs.com/wupiao/articles/13323283.html 1.区别 x.data和x.detach()都是从原有计算中分离出来的一个tensor变量 ,并且都是inplace operation.在进行autograd追踪求倒时,两个的常量是相 阅读全文
posted @ 2021-07-09 10:42 lypbendlf 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 1.访问中间层 import torch import torch.nn as nn model = nn.Sequential( nn.Linear(10,10), nn.ReLU(), nn.Linear(10,10), nn.ReLU(), nn.Linear(10,10), nn.ReLU( 阅读全文
posted @ 2021-07-09 10:38 lypbendlf 阅读(1127) 评论(0) 推荐(0) 编辑