欢迎您访问365答案网,请分享给你的朋友!
生活常识 学习资料

pytorch入门基础

时间:2023-05-20

筛选数据:

x = torch.linspace(1, 4*4*4*4, steps=4*4*4*4).view(4,4,4,4) print(0,x[0]) print(1,x[1]) print(2,x[2]) print(3,x[3]) print(x.size()) x = x[[3, 2, 3, 2]] print(0, x[0]) print(1, x[1]) print(2, x[2]) print(3, x[3])

import torchr = torch.linspace(0.0001, 2*3*2, steps=4*3*2)r1=r.view(4,3,2)max_res=torch.max(r1, 1、/ r1).max(2)max_res=max_res[0]print(max_res)j = max_res[0] < 4print(j)

Copyright © 2016-2020 www.365daan.com All Rights Reserved. 365答案网 版权所有 备案号:

部分内容来自互联网,版权归原作者所有,如有冒犯请联系我们,我们将在三个工作时内妥善处理。