Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. for name, child in model.named_children():
  2. print('name: ', name)
  3. print('isinstance(param, nn.Module): ', isinstance(param, nn.Module))
  4. print('isinstance(param, nn.Parameter): ', isinstance(param, nn.Parameter))
  5. print('isinstance(param, torch.Tensor) ', isinstance(param, torch.Tensor))
  6. print('=====')
  7.  
  8. # Also try model.children(). It doesn't return the name of the children, but the children (nn.Module objects)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement