pytorch->maxpool2d的简单应用
import torch
from torch import nn
from torch.nn import MaxPool2d
input torch.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]],dtypetorch.float32)
input torch.reshape(input,(-1,1,5,5))
print(f输入形状:{input.shape})
class Tudui(nn.Module…
2026/6/17 11:08:59