I have been trying some additional stuff:
Rephrased problem: The dimensionality of the desired embedding (after average pooling and before the fully connected layer) directly corresponds to the number of channels. Those channels are influenced by the convolutional layers.
Preliminary solution: I adjusted input- and output channels in the ResNet-class 19:
class ResNet(nn.Module):

    def __init__(self, block, layers, num_classes=1000):
        self.inplanes = 32
        super(ResNet, self).__init__()
        self.conv1 = nn.Conv2d(3, 32, kernel_size=7, stride=2, padding=3,
                               bias=False)
        self.bn1 = nn.BatchNorm2d(32)
        self.relu = nn.ReLU(inplace=True)
        self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)
        self.layer1 = self._make_layer(block, 32, layers[0])
        self.layer2 = self._make_layer(block, 64, layers[1], stride=2)
        self.layer3 = self._make_layer(block, 128, layers[2], stride=2)
        self.layer4 = self._make_layer(block, 256, layers[3], stride=2)
        self.avgpool = nn.AvgPool2d(7, stride=1)
        self.fc = nn.Linear(256 * block.expansion, num_classes)

As I did not receive an error in my previous solution (=without adjusting dimensionality of the convent-layer, see entry post), I cannot yet verify my solution. Maybe one of you can?
Best,
Always