Agent skill · AI & Agents

pytorch-model-cli

Guidance for implementing CLI tools that perform inference using PyTorch models in native languages (C/C++/Rust). This skill should be used when tasks involve extracting weights from PyTorch .pth files, implementing neural network forward passes in C/C++, or creating standalone inference tools without Python dependencies.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill pytorch-model-cli --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 5 KB
Bundled scripts: none
Path: skills/ai-ml/pytorch-model-cli/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# PyTorch Model CLI Implementation ## Overview This skill provides procedural guidance for creating command-line tools that perform inference using PyTorch models without Python dependencies. These tasks typically involve extracting weights from `.pth` files, implementing forward passes in C/C++, and handling image preprocessing correctly. ## Workflow ### Phase 1: Analysis and Planning 1. **Examine the PyTorch model architecture** - Load the `.pth` file in Python to understand the model structure - Print layer names, weight shapes, and activation functions - Document the expected input dimensions and preprocessing requirements 2. **Inspect input data format** - Check image dimensions, color format (grayscale/RGB/RGBA), and bit depth - Determine expected normalization (0-1, -1 to 1, ImageNet stats, etc.) - Verify input matches model expectations (e.g., MNIST expects 28x28 grayscale) 3. **Plan weight extraction format** - Decide on intermediate format (JSON, binary, etc.) - Note that PyTorch stores linear layer weights as `[out_features, in_features]` - Account for any transposition needed during matrix multiplication ### Phase 2: Weight Extraction 1. **Create a weight extraction scr

What's inside
Steps it walks through
  1. Overview
  2. Workflow
  3. Phase 1: Analysis and Planning
  4. Phase 2: Weight Extraction
  5. Phase 3: Native Implementation
  6. Phase 4: Verification
  7. Common Pitfalls
  8. Weight Dimension Confusion
  9. Image Preprocessing Errors
  10. Premature Cleanup
  11. Incomplete File Writes
  12. Verification Checklist
  13. Resources
  14. references/
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the pytorch-model-cli skill do?

Guidance for implementing CLI tools that perform inference using PyTorch models in native languages (C/C++/Rust). This skill should be used when tasks involve extracting weights from PyTorch .pth files, implementing neural network forward passes in C/C++, or creating standalone inference tools without Python dependencies.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill pytorch-model-cli --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going