Last active
June 19, 2020 10:54
-
-
Save n0obcoder/37873ede4f6b129cc502dd55be4e4976 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for name, child in model.named_children(): | |
| print('name: ', name) | |
| print('isinstance(child, nn.Module): ', isinstance(child, nn.Module)) | |
| print('isinstance(child, nn.Parameter): ', isinstance(child, nn.Parameter)) | |
| print('isinstance(child, torch.Tensor) ', isinstance(child, torch.Tensor)) | |
| print('=====') | |
| # Also try model.children(). It doesn't return the name of the children, but the children (nn.Module objects) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment