Okay, that sounds good! You are, however, missing a part of your model.
CNNs usually consist of the feature extraction part (convolutions, poolings, etc.), and the classification part (few fully connected layers to learn how extracted features contribute to the classification, in your case, and in the end a softmax layer, which gives you the probability distribution of your classes).
In Pytorch, it is recommended that you extend the nn.Module class when writing a model.
class ConvNet(nn.Module):

def __init__(self, n_classes):
   super.__init__()
   self.featurizer = nn.Sequential(...) # what you  have in your model variable 
   self.classifier = nn.Sequential(...) # 2-3 linear layers, first should in_features = have n_kernels * h_kernel * w_kernel from last conv layer, last should have out_feautres=n_classes )

def forward(self, x)
   # x (b, c, h, w)

   x = self.featurizer(x) # x (b, n_kernels, h_kernel, w_kernel)

   x = torch.flatten(x, start_dim=1) # x (b, n_kernels * h_kernel, w_kernel)

   x = self.classifier(x) # x (b, n_classes)
   x = torch.nn.f.softmax(x) 

On this, you should be able to apply cross-entropy loss. The optimizer, you could also instantiate separately. Let me know if you get stuck