Сlassification using convolutional layers I have a simple neural network of 2 layers, recognizing 10 classes:

self.layer1 = nn.Sequential(
    nn.Conv2d(1, 32, kernel_size=5, stride=1, padding=2),
    nn.ReLU(),
    nn.MaxPool2d(kernel_size=2, stride=2))
self.fc1 = nn.Linear(14 * 14 * 32, 10)


How can a classification be made using the convolutional layer in this case?
You need Dense() layers after convolution / pooling layers. Conv and max-pool are meant to process pixel data in a format that can be later received from dense layers.
It's the Dense() output layer that, using a softmax activation, can technically perform the classification (by returning a one-hot encoded vector).