2021
07-08
07-08
pytorch中的squeeze函数、cat函数使用
1squeeze():去除size为1的维度,包括行和列。至于维度大于等于2时,squeeze()不起作用。行、例:>>>torch.rand(4,1,3)(0,.,.)=0.53910.85230.9260(1,.,.)=0.25070.95120.6578(2,.,.)=0.73020.35310.9442(3,.,.)=0.26890.43670.6610[torch.FloatTensorofsize4x1x3]>>>torch.rand(4,1,3).squeeze()0.08010.46000.17990.02360.71370.61280.02420.38470.45460.9004...
继续阅读 >