refactor:pytorch
✓重构 PyTorch 代码以提高可维护性、可读性并遵守最佳实践。识别并修复 DRY 违规、长函数、深度嵌套、SRP 违规以及模块化组件的机会。应用 PyTorch 2.x 模式,包括 torch.compile 优化、自动混合精度 (AMP)、优化的 DataLoader 配置、模块化 nn.Module 设计、梯度检查点、CUDA 内存管理、PyTorch Lightning 集成、自定义数据集类、模型工厂模式、权重初始化和再现性模式。
SKILL.md
You are an elite PyTorch refactoring specialist with deep expertise in writing clean, maintainable, and high-performance deep learning code. Your mission is to transform working PyTorch code into exemplary code that follows PyTorch 2.x best practices, modern design patterns, and optimal performance strategies.
You will apply these principles rigorously to every refactoring task:
If you encounter code that cannot be safely refactored without more context or that would require architectural changes, explicitly state this and request clarification from the user.
重构 PyTorch 代码以提高可维护性、可读性并遵守最佳实践。识别并修复 DRY 违规、长函数、深度嵌套、SRP 违规以及模块化组件的机会。应用 PyTorch 2.x 模式,包括 torch.compile 优化、自动混合精度 (AMP)、优化的 DataLoader 配置、模块化 nn.Module 设计、梯度检查点、CUDA 内存管理、PyTorch Lightning 集成、自定义数据集类、模型工厂模式、权重初始化和再现性模式。 来源:snakeo/claude-debug-and-refactor-skills-plugin。
可引用信息
为搜索与 AI 引用准备的稳定字段与命令。
- 安装命令
npx skills add https://github.com/snakeo/claude-debug-and-refactor-skills-plugin --skill refactor:pytorch- 分类
- </>开发工具
- 认证
- ✓
- 收录时间
- 2026-02-06
- 更新时间
- 2026-02-18
快速解答
什么是 refactor:pytorch?
重构 PyTorch 代码以提高可维护性、可读性并遵守最佳实践。识别并修复 DRY 违规、长函数、深度嵌套、SRP 违规以及模块化组件的机会。应用 PyTorch 2.x 模式,包括 torch.compile 优化、自动混合精度 (AMP)、优化的 DataLoader 配置、模块化 nn.Module 设计、梯度检查点、CUDA 内存管理、PyTorch Lightning 集成、自定义数据集类、模型工厂模式、权重初始化和再现性模式。 来源:snakeo/claude-debug-and-refactor-skills-plugin。
如何安装 refactor:pytorch?
打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/snakeo/claude-debug-and-refactor-skills-plugin --skill refactor:pytorch 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用
这个 Skill 的源码在哪?
https://github.com/snakeo/claude-debug-and-refactor-skills-plugin
详情
- 分类
- </>开发工具
- 来源
- skills.sh
- 收录时间
- 2026-02-06