Pytorch学习12_最大池化的使用
输入图像 import torch from torch import nninputtorch.tensor([[1,2,0,3,1],[0,1,2,3,1],[1,2,1,0,0],[5,2,3,1,1],[2,1,0,1,1]]) inputtorch.reshape(input,(-1,1,5,5))#二维张量转换为一个四维张量。(batch_size, channels, height, width)print(input.shape)ceil_modeTrue…
2025-01-26