padding & stride
from mxnet import autograd,ndfrom mxnet import gluon,initfrom mxnet.gluon import nn,loss as glossfrom mxnet.gluon import data as gdatadef comp_conv2d(conv2d,X): conv2d.initialize() # (样本,通道,高,宽) X = X.reshape((1,1)+X.shape) #print(X.shape) Y = conv2d(X) return Yconv2d = nn.Conv2D(1,kernel_size=(3,3),padding=1)X = nd.random.uniform(shape=(8,8))#print(X)#print(comp_conv2d(conv2d,X).shape)conv2d = nn.Conv2D(1,kernel_size=(5,3),padding=(2,1))#print(comp_conv2d(conv2d,X).shape)conv2d = nn.Conv2D(1,kernel_size=3,padding=1,strides=2)print(comp_conv2d(conv2d,X).shape)conv2d = nn.Conv2D(1,kernel_size=(3,5),padding=(0,1),strides=(3,4))print(comp_conv2d(conv2d,X).shape)