@anantguptadbl
Yes, I agree that the nn.Sequential model works like this and it is possible to view it on wandb, in fact in my second code snippet I am able to view the graphs of the gradient correctly.

image1816×692 29.1 KB

but the difference with your code is that in my case, at some point the network proceeds in parallel and not completely in sequence (the actor and critic subnets). In this case, if I pass the shared_layer output to the two subnets (which are two nn.Sequential modules) the loss values ​​become completely meaningless and I think it is due to the use of the nn.Sequential modules, since the rest of the program is exactly the same