import torch
import torch.nn as nn
defMyCon2D(X,K):
h,w=K.shape
Y=torch.zeros((X.shape[0]-h+1,X.shape[1]-w+1))#定义输出的大小for i inrange(Y.shape[0]):for j inrange(Y.shape[1]):
深度学习网络中基本操作代码实现1 卷积操作代码实现卷积操作import torchimport torch.nn as nndef MyCon2D(X,K): h,w=K.shape Y=torch.zeros((X.shape[0]-h+1,X.shape[1]-w+1)) #定义输出的大小 for i in range(Y.shape[0]): ...