pytorch model name layer code example Example: how to get pytroch model layer name for name, layer in model.named_modules(): print(name, layer)