Hi,
In PyTorch v1.5.1, you can use trace.code. Here is an example:

  
    
    
    How can I know what funcitonal layers (e.g. F.relu) are used? 
  
  
    Hi, 
As you might know that PyTorch creates graphs dynamically when you provide data to network, you can get it’s behavior by applying an input and tracing graph construction. Here is the code: 
class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.fc1 = nn.Linear(28*28, 300)
        self.fc2 = nn.Linear(300, 100)
        self.fc3 = nn.Linear(100, 10)

    def forward(self, x):
        x = x.view(-1, 28*28)
        x = F.relu(self.fc1(x))
        x = F.re…