摘要: import torch x = torch.randn(3, requires_grad=True) y = x*2 print(y.data.norm()) print(torch.sqrt(torch.sum(torch.pow(y,2)))) #其实就是对y张量L2范数,先对y中每一项取平方 阅读全文
posted @ 2020-06-25 17:20 九叶草 阅读(5973) 评论(0) 推荐(0) 编辑