Your current model output has the shape [4, 3, 32, 32], which points towards a multi-class segmentation use case where the model output has the shape [batch_size, nb_classes, height, width].
For this use case the target should have the shape [batch_size, height, width] (in your case [4, 32, 32]) and contain the class indices in the range [0, nb_classes=1] (in your case [0, 3]).
However, given that the target has a shape of [batch_size=4], you are either passing the wrong model output to the criterion or the target is wrong and doesn’t contain the class indices for each pixel.