CNN 互相关运算 二维互相关(cross-correlation)运算的输入是一个二维输入数组和一个二维核(kernel)数组,输出也是一个二维数组,其中核数组通常称为卷积核或过滤器(filter) import torch import torch.nn as nn def corr2d(X, K): H, W = X.shape h, w = K.shape Y = torch.zeros(H - h + 1, W - w + 1) for i in range(Y.shape[0]): for j in range(Y.shape[1]