pytorch.info summary for Generator of AN equivalent to discriminator or summary for whole GAN
Is it possible to generate a summary for the generator network of a GAN equivalent to the summary for the discriminator network using pytorch.info (containing inputs and outputs) or is there even a standard summary for the whole GAN including both networks?
For the Discriminator I used the following:
model = Discriminator()
batch_size = 32
summary(model, input_size=(batch_size, 3, 28, 28))

and received the following summary, which I would also like for the generator (see below summary):
==========================================================================================
Layer (type:depth-idx)                   Output Shape              Param #
==========================================================================================
Discriminator                            [32, 1]                   --
├─Sequential: 1-1                        [32, 1]                   --
│    └─Linear: 2-1                       [32, 2048]                4,818,944
│    └─ReLU: 2-2                         [32, 2048]                --
│    └─Dropout: 2-3                      [32, 2048]                --
│    └─Linear: 2-4                       [32, 1024]                2,098,176
│    └─ReLU: 2-5                         [32, 1024]                --
│    └─Dropout: 2-6                      [32, 1024]                --
│    └─Linear: 2-7                       [32, 512]                 524,800
│    └─ReLU: 2-8                         [32, 512]                 --
│    └─Dropout: 2-9                      [32, 512]                 --
│    └─Linear: 2-10                      [32, 256]                 131,328
│    └─ReLU: 2-11                        [32, 256]                 --
│    └─Dropout: 2-12                     [32, 256]                 --
│    └─Linear: 2-13                      [32, 1]                   257
│    └─Sigmoid: 2-14                     [32, 1]                   --
==========================================================================================´´´
Total params: 7,573,505
Trainable params: 7,573,505
Non-trainable params: 0
Total mult-adds (M): 242.35
==========================================================================================
Input size (MB): 0.30
Forward/backward pass size (MB): 0.98
Params size (MB): 30.29
Estimated Total Size (MB): 31.58
==========================================================================================

For the generator I used the following to create a summary and unfortunately I wasnt able to includ ethe column for output shape as well as everything under and including the input row (as above):
model = Generator()
batch_size = 32
summary(model, output_size=(batch_size, 3, 28, 28))

and received the following shorter summary:
=================================================================
Layer (type:depth-idx)                   Param #
=================================================================
Generator                                --
├─Sequential: 1-1                        --
│    └─Linear: 2-1                       25,856
│    └─ReLU: 2-2                         --
│    └─Linear: 2-3                       131,584
│    └─ReLU: 2-4                         --
│    └─Linear: 2-5                       525,312
│    └─ReLU: 2-6                         --
│    └─Linear: 2-7                       2,099,200
│    └─ReLU: 2-8                         --
│    └─Linear: 2-9                       4,819,248
│    └─Tanh: 2-10                        --
=================================================================
Total params: 7,601,200
Trainable params: 7,601,200
Non-trainable params: 0
=================================================================


This package is not recommended for debugging your code, you should therefore always make sure your code runs on random data before testing the summary.
In the second group of commands, you are using output_size instead of input_size (cf. src). Looking at your code for Generator, the input shape should be (batch_size, 100). Additionally your final linear layer should output a total of 3*28*28 values in order for you to reshape to an image of shape (3, 28, 28).
class Generator(nn.Module):
    def __init__(self):
        super().__init__()
        self.model = nn.Sequential(
            nn.Linear(100, 256),
            nn.ReLU(),
            nn.Linear(256, 512),
            nn.ReLU(),
            nn.Linear(512, 1024),
            nn.ReLU(),
            nn.Linear(1024, 2048),
            nn.ReLU(),
            nn.Linear(2048, 28*28*3),
            nn.Tanh(),
        )

    def forward(self, x):
        output = self.model(x)
        output = output.view(x.size(0), 3, 28, 28)
        return output

Which you can summarize with:
&gt;&gt;&gt; summary(model, input_size=(10,100))
========================================================================================
Layer (type:depth-idx)                   Output Shape              Param #
========================================================================================
Generator                                [10, 3, 28, 28]           --
├─Sequential: 1-1                        [10, 2352]                --
│    └─Linear: 2-1                       [10, 256]                 25,856
│    └─ReLU: 2-2                         [10, 256]                 --
│    └─Linear: 2-3                       [10, 512]                 131,584
│    └─ReLU: 2-4                         [10, 512]                 --
│    └─Linear: 2-5                       [10, 1024]                525,312
│    └─ReLU: 2-6                         [10, 1024]                --
│    └─Linear: 2-7                       [10, 2048]                2,099,200
│    └─ReLU: 2-8                         [10, 2048]                --
│    └─Linear: 2-9                       [10, 2352]                4,819,248
│    └─Tanh: 2-10                        [10, 2352]                --
========================================================================================
Total params: 7,601,200
Trainable params: 7,601,200
Non-trainable params: 0
Total mult-adds (M): 76.01
========================================================================================
Input size (MB): 0.00
Forward/backward pass size (MB): 0.50
Params size (MB): 30.40
Estimated Total Size (MB): 30.90
========================================================================================

