Ok, I’ve read through the paper and tried to change your code accordingly.
Let’s walk through the changes and see if it’s right.

The common body of convolution layers is composed of a series of six convolution layers. conv1 … to conv6

It seems in your architecture you used the “common body” only for the real/fake output and skipped the conv6 layer for the style output.
Let’s make sure both losses use all 6 conv layers.

After passing a image to the common convD body, it will produce a feature map or size (4×4×512)

Now that we use all 6 conv layers we get the desired output.

The real/fake Dr head collapses the (4×4×512) by a fully connected to produce Dr(c|x)(probability of image coming for the real image distribution)

I’ve added a self.real_fake_head as a nn.Linear layer to achieve this.
It’s defined as self.real_fake_head = nn.Linear(512*4*4, 1).

The multi-label probabilities Dc(ck|x) head is produced by passing the(4×4×512) into 3 fully collected layers  sizes 1024, 512, K, respectively, where K is the number of style classes.

I’ve changed the number of input features to 512*4*4 so that we can use these linear layers as in the paper.
Here is the full code for the discriminator. I’ve kept most of the code and changed just a bit:
class Discriminator(nn.Module):
    def __init__(self):
        super(Discriminator, self).__init__()
        num_disc_filters = 64
        y_dim = 27
        channels = 3
        self.conv = nn.Sequential(
                nn.Conv2d(channels, num_disc_filters//2, 4, 2, 1, bias=False),
                nn.LeakyReLU(0.2, inplace=True),
          
                nn.Conv2d(num_disc_filters//2, num_disc_filters, 4, 2, 1, bias=False),
                nn.BatchNorm2d(num_disc_filters),
                nn.LeakyReLU(0.2, inplace=True),
         
                nn.Conv2d(num_disc_filters, num_disc_filters * 2, 4, 2, 1, bias=False),
                nn.BatchNorm2d(num_disc_filters * 2),
                nn.LeakyReLU(0.2, inplace=True),
           
                nn.Conv2d(num_disc_filters * 2, num_disc_filters * 4, 4, 2, 1, bias=False),
                nn.BatchNorm2d(num_disc_filters * 4),
                nn.LeakyReLU(0.2, inplace=True),
    
                nn.Conv2d(num_disc_filters * 4, num_disc_filters * 8, 4, 2, 1, bias=False),
                nn.BatchNorm2d(num_disc_filters * 8),
                nn.LeakyReLU(0.2, inplace=True),
    
                #Inclusion of this last layer leads to the wonderful
                # RuntimeError: Calculated input size: (3 x 3). Kernel size: (4 x 4). 
                # a problem for another day :(. Thus currently commented out
                 #nn.Conv2d(num_disc_filters * 8, num_disc_filters * 8, 4, 2, 1, bias=False),
                #nn.BatchNorm2d(num_disc_filters * 8),
                #nn.LeakyReLU(0.2, inplace=True),
            )
        self.final_conv = nn.Conv2d(num_disc_filters * 8, 512, 4, 2, 1, bias=False)
        
        self.real_fake_head = nn.Linear(512*4*4, 1)
        
        self.sig = nn.Sigmoid()
        self.fc = nn.Sequential() 
        self.fc.add_module("linear_layer.{0}".format(num_disc_filters*16),nn.Linear(512*4*4,num_disc_filters*16))
        self.fc.add_module('relu.{0}'.format(num_disc_filters*16), nn.LeakyReLU(0.2, inplace=True))
        self.fc.add_module("linear_layer.{0}".format(num_disc_filters*8),nn.Linear(num_disc_filters*16,num_disc_filters*8))
        self.fc.add_module('relu.{0}'.format(num_disc_filters*8), nn.LeakyReLU(0.2, inplace=True))
        self.fc.add_module("linear_layer.{0}".format(num_disc_filters),nn.Linear(num_disc_filters*8,y_dim))
        self.fc.add_module('relu.{0}'.format(num_disc_filters), nn.LeakyReLU(0.2, inplace=True))
        self.fc.add_module('softmax',nn.Softmax(dim=1))
       
    def forward(self, inp):

        x = self.conv(inp)
        x = self.final_conv(x) # its size is [64,1,1,1]
        x = x.view(x.size(0),-1) # To flatten the 2D into 1D -> now has size [64,2048]
        real_out = self.sig(self.real_fake_head(x))
        real_out = real_out.view(-1,1).squeeze(1)
        
        style = self.fc(x) # THIS IS THE LINE THAT FAILS
        style = torch.mean(style,1) #Get the mean of the style (class labels) to ensure a 64x1 tensor as opposed to 64 x y_dim
        return real_out,style


disc = Discriminator()
x = Variable(torch.randn(1, 3, 256, 256))
output = disc(x)