Complete the code to create a 2D convolutional layer with 3 input channels and 16 output channels.
conv_layer = nn.Conv2d([1], 16, kernel_size=3)
The first argument to nn.Conv2d is the number of input channels. Here, it should be 3.
Complete the code to apply the convolutional layer to the input tensor.
output = conv_layer([1])You apply the convolutional layer to the input tensor by calling it like a function with the input tensor as argument.
Fix the error in the code by completing the missing argument for padding.
conv_layer = nn.Conv2d(3, 16, kernel_size=3, padding=[1])
Padding of 1 keeps the output size the same when using a 3x3 kernel.
Fill both blanks to create a convolutional layer with stride 2 and kernel size 5.
conv_layer = nn.Conv2d(3, 32, kernel_size=[1], stride=[2])
The kernel size is 5 and stride is 2 to downsample the input.
Fill all three blanks to create a Conv2d layer with 1 input channel, 10 output channels, kernel size 3, padding 1.
conv_layer = nn.Conv2d([1], [2], kernel_size=[3], padding=1)
The layer has 1 input channel, 10 output channels, and kernel size 3 with padding 1.