Last active
August 12, 2019 18:14
-
-
Save n0obcoder/ac7ad1c38d372389be88c32120997171 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 , param in model.named_parameters(): | |
| print('type(param): ', type(param)) | |
| print('isinstance(param, nn.Module): ', isinstance(param, nn.Module)) | |
| print('isinstance(param, nn.Parameter): ', isinstance(param, nn.Parameter)) | |
| print('isinstance(param, torch.Tensor) ', isinstance(param, torch.Tensor)) | |
| print('=====') | |
| # Also try model.parameters(). It doesn't return the name of the parameters but just the parameters. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment