# generate with torch python - <<'EOF' import torch, torch.nn as nn model = nn.Linear(5, 2) torch.save(model.state_dict(), "state_dict.pth") EOF