Solved by ptrblck in post #2 
              
              
                You could check if the .__dict__ or dir() approach would work for you: 
lin = nn.Linear(1, 1)
print(lin.__dict__)
print(dir(lin))

However, both approaches would still need some parsing, checks, etc. since a lot of internals would be printed.