The first argument to Conv2d are the in_channels.
From the docs:

Conv2d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True)

The last layer in the discriminator has therefore one output channel and only one “pixel” (the shape before the last layer is [batch_size, ndf*8, 4, 4], so that a 4x4 kernel returns only one value).
If you want to change the number of filters/channels try:
... 
nn.Conv2d(ndf * 4, ndf * 16, 4, 2, 1, bias=False),
nn.BatchNorm2d(ndf * 16),
nn.LeakyReLU(0.2, inplace=True),
# state size. (ndf*16) x 4 x 4
nn.Conv2d(ndf * 16, 1, 4, 1, 0, bias=False),
nn.Sigmoid()