Conv layers have a few mandatory arguments, i.e. in_channels, out_channels, and kernel_size.
Other arguments like stride and padding are optional.
A short explanation:


in_channels: the number of input channels of the activation volume to the current conv layer. In case it’s the first layer, you have to set it to the number of channels of your input image. In your case, as you are dealing with grayscale images, you would have to set it to 1.

out_channels: number of filter kernels in your conv layer. Each filter kernel creates a channel in the output activation volume. The first conv layer has 6 kernels and outputs an activation of [batch_size, 6, h, w]. This also means the following conv layer should use in_channels=6.

kernel_size: the spatial size of your kernel (height and width). If only a single value is specified, both the height and width will be set to this value.

If you want to pass your conv output to a linear layer, you should flatten it in the standard use case.
Your fc1 layer takes in_features=16*5*5, which means the activation being passed to it is of shape [batch_size, 16, 5, 5]. Similar to the conv layers, the out_features of one linear layers define the in_features of the subsequent one, if no other (pooling) operation is performed.
For an input size of [1, 100, 100], you’ll get an error, since the in_features of self.fc1 won’t match the activation shape, and you should specify it as in_features=16 * 23 * 23.
Have a look at Stanfrod’s CS231n - CNN section 37 where all shapes and operations are beautifully explained and let me know if you need some more information.
PS: You can add code snippets using three backticks `