Setting multiple kernels for multiple size of input CNN

Hi, I have a CNN code like this:

	CNN_modules = []
	CNN_modules.append(nn.Conv2d(1, 256, (x, 33)))
	CNN_modules.append(nn.ReLU())
	
	CNN_modules.append(nn.Conv2d(256, 256, (17, 17)))
	CNN_modules.append(nn.ReLU())

	CNN_modules.append(nn.Conv2d(256, 256, (9, 9)))
	CNN_modules.append(nn.ReLU())

	CNN_modules.append(nn.Conv2d(256, 256, (5, 5)))
	CNN_modules.append(nn.ReLU())

	CNN_modules.append(nn.Conv2d(256, 256, (3, 3)))
	CNN_modules.append(nn.ReLU())

	CNN_modules.append(nn.Conv2d(256, 256, (2, 2)))
	CNN_modules.append(nn.ReLU())

The problem is that the input data of that CNN has different heights, for example, they could be [256, 64], [93, 64], … so the question is how can I set “x” in the first layer, which makes all of the input be [32,32] in the second layer?

Thank you so much

The usual way is to do rescaling of the inputs or AdaptiveAvgPool2d (or the MaxPool equivalent) somewhere later.

Best regards

Thomas