Math  for convolutional layers widh kernel=1 and stride=1 padding=0 will keep same wxh. kernel=3, stride=2, padding=1 will halve them.
You can use loops. Or create inner models and call them. Take a look at source code 1 of resnet, for example.