[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"tool-chelsea0x3b--dfdx":3,"similar-chelsea0x3b--dfdx":148},{"id":4,"github_repo":5,"name":6,"description_en":7,"description_zh":8,"ai_summary_zh":8,"readme_en":9,"readme_zh":10,"quickstart_zh":11,"use_case_zh":12,"hero_image_url":13,"owner_login":14,"owner_name":15,"owner_avatar_url":16,"owner_bio":17,"owner_company":18,"owner_location":17,"owner_email":19,"owner_twitter":17,"owner_website":17,"owner_url":20,"languages":21,"stars":38,"forks":39,"last_commit_at":40,"license":41,"difficulty_score":42,"env_os":43,"env_gpu":44,"env_ram":43,"env_deps":45,"category_tags":51,"github_topics":53,"view_count":73,"oss_zip_url":17,"oss_zip_packed_at":17,"status":74,"created_at":75,"updated_at":76,"faqs":77,"releases":107},2678,"chelsea0x3b\u002Fdfdx","dfdx","Deep learning in Rust, with shape checked tensors and neural networks","dfdx 是一个专为 Rust 语言打造的深度学习库，致力于在提供高性能计算的同时，确保代码的极致安全与易用性。它核心解决了传统动态类型深度学习框架中常见的“形状不匹配”运行时错误痛点，通过 Rust 强大的类型系统，将张量维度检查提前至编译阶段。这意味着如果神经网络层的输入输出维度不一致，代码将无法通过编译，从而在开发早期就规避了大量潜在 Bug。\n\ndfdx 非常适合追求内存安全、高性能以及对代码可靠性有严苛要求的 Rust 开发者、系统程序员及算法研究人员使用。其独特的技术亮点包括：支持高达 6 维的 GPU 加速张量运算（需 CUDA 环境）；允许同时使用编译期固定尺寸和运行期动态尺寸的张量；提供如线性层、卷积层及 Transformer 等符合人体工学的神经网络构建模块；以及内置 SGD、Adam 等主流优化器。此外，dfdx 巧妙利用 Rust 的元组特性来表示顺序神经网络模型，使得模型定义既简洁又直观。虽然目前项目仍处于早期预发布阶段，但其“编译即正确”的设计理念为在系统级语言中构建稳健的深度学习应用开辟了新的路径。","# dfdx: shape checked deep learning in rust\n\n[![](https:\u002F\u002Fdcbadge.vercel.app\u002Fapi\u002Fserver\u002FAtUhGqBDP5)](https:\u002F\u002Fdiscord.gg\u002FAtUhGqBDP5)\n[![crates.io](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fv\u002Fdfdx?style=for-the-badge)](https:\u002F\u002Fcrates.io\u002Fcrates\u002Fdfdx)\n[![docs.rs](https:\u002F\u002Fimg.shields.io\u002Fdocsrs\u002Fdfdx?label=docs.rs%20latest&style=for-the-badge)](https:\u002F\u002Fdocs.rs\u002Fdfdx)\n\n\nErgonomics & safety focused deep learning in Rust.\n\n**Still in pre-alpha state. The next few releases are planned to be breaking releases.**\n\nFeatures at a glance:\n1. :fire: GPU accelerated tensor library with shapes up to 6d!\n2. Shapes with both compile and runtime sized dimensions. (e.g. `Tensor\u003C(usize, Const\u003C10>)>` and `Tensor\u003CRank2\u003C5, 10>>`)\n3. A large library of tensor operations (including `matmul`, `conv2d`, and much more).\n    1. All tensor operations shape and type checked at compile time!!\n4. Ergonomic neural network building blocks (like `Linear`, `Conv2D`, and `Transformer`).\n5. Standard deep learning optimizers such as `Sgd`, `Adam`, `AdamW`, `RMSprop`, and more.\n\n`dfdx` is on [crates.io](https:\u002F\u002Fcrates.io\u002Fcrates\u002Fdfdx)! Use by adding this to your `Cargo.toml`:\n\n```toml\ndfdx = \"0.13.0\"\n```\n\nSee the documentation at [docs.rs\u002Fdfdx](https:\u002F\u002Fdocs.rs\u002Fdfdx).\n\n[1] https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAutomatic_differentiation#Reverse_accumulation\n\n## Design Goals\n\n1. Ergonomics the whole way down (both frontend interface & internals).\n2. Check as much at compile time as possible (i.e. don't compile if something is not correct).\n3. Maximize performance.\n4. Minimize unsafe code[1]\n5. Minimize Rc\u003CRefCell\u003CT>> used in internal code[2]\n\n[1] Currently the only unsafe calls are for matrix multiplication.\n\n[2] The only things that use `Arc` are tensors to store their data. `Arc` is used instead of `Box` to reduce\nallocations when tensors are cloned.\n\n## GPU acceleration with CUDA\n\nEnable the `cuda` feature to start using the `Cuda` device! Requires the installation of nvidia's cuda toolkit. See [feature flags docs](https:\u002F\u002Fdocs.rs\u002Fdfdx\u002Flatest\u002Fdfdx\u002Ffeature_flags\u002Findex.html) for more info.\n\n## API Preview\n\nCheck [examples\u002F](examples\u002F) for more details.\n\n1. 👌 Simple Neural Networks API, completely shape checked at compile time.\n\n```rust\ntype Mlp = (\n    (Linear\u003C10, 32>, ReLU),\n    (Linear\u003C32, 32>, ReLU),\n    (Linear\u003C32, 2>, Tanh),\n);\n\nfn main() {\n    let dev: Cuda = Default::default(); \u002F\u002F or `Cpu`\n    let mlp = dev.build_module::\u003CMlp, f32>();\n    let x: Tensor\u003CRank1\u003C10>, f32, Cpu> = dev.zeros();\n    let y: Tensor\u003CRank1\u003C2>, f32, Cpu> = mlp.forward(x);\n    mlp.save(\"checkpoint.npz\")?;\n}\n```\n\n2. 📈 Ergonomic Optimizer API\n\n```rust\ntype Model = ...\nlet mut model = dev.build_module::\u003CModel, f32>();\nlet mut grads = model.alloc_grads();\nlet mut sgd = Sgd::new(&model, SgdConfig {\n    lr: 1e-2,\n    momentum: Some(Momentum::Nesterov(0.9))\n});\n\nlet loss = ...\ngrads = loss.backward();\n\nsgd.update(&mut model, &grads);\n```\n\n3. 💡 Const tensors can be converted to and from normal rust arrays\n```rust\nlet t0: Tensor\u003CRank0, f32, _> = dev.tensor(0.0);\nassert_eq!(t0.array(), &0.0);\n\nlet t1 \u002F*: Tensor\u003CRank1\u003C3>, f32, _>*\u002F = dev.tensor([1.0, 2.0, 3.0]);\nassert_eq!(t1.array(), [1.0, 2.0, 3.0]);\n\nlet t2: Tensor\u003CRank2\u003C2, 3>, f32, _> = dev.sample_normal();\nassert_ne!(t2.array(), [[0.0; 3]; 2]);\n```\n\n## Fun\u002Fnotable implementation details\n\n### Module\n\n```rust\npub trait Module\u003CInput> {\n    type Output;\n    fn forward(&self, input: Input) -> Self::Output;\n}\n```\n\nFrom this flexible trait we get:\n1. Single & batched inputs (just have multiple impls!)\n2. Multiple inputs\u002Foutputs (multi-headed modules, or rnns)\n3. Behavior different when tape is present or not (**not** the .train()\u002F.eval() behavior present in other libraries!).\n\n### Tuples represent feedforward (a.k.a sequential) modules\n\nSince we can implement traits for tuples, which is *not possible in other languages* AFAIK, they provide a very nice frontend\nfor sequentially executing modules.\n\n```rust\n\u002F\u002F no idea why you would do this, but you could!\ntype Model = (ReLU, Sigmoid, Tanh);\nlet model = dev.build_module::\u003CModel, f32>();\n```\n\n```rust\ntype Model = (Linear\u003C10, 5>, Tanh)\nlet model = dev.build_module::\u003CModel, f32>();\n```\n\nHow implementing Module for a 2-tuple looks:\n```rust\nimpl\u003CInput, A, B> Module\u003CInput> for (A, B)\nwhere\n    Input: Tensor,\n    A: Module\u003CInput>,        \u002F\u002F A is a module that takes Input\n    B: Module\u003CA::Output>,    \u002F\u002F B is a module that takes A's Output\n{\n    type Output = B::Output; \u002F\u002F the output of this is B's Output\n    fn forward(&self, x: Input) -> Self::Output {\n        let x = self.0.forward(x);\n        let x = self.1.forward(x);\n        x\n    }\n}\n```\n\nModules implemented for Tuples up to 6 elements, but *you can arbitrarily nest them*!\n\n### No `Rc\u003CRefCells\u003CT>>` used - Gradient tape is not kept behind a cell!\n\nOther implementations may store a reference to the gradient tape directly on tensors, which requires mutating tensors or using Rc\u002FRefcells all over the place.\n\nWe've figured out an elegant way to avoid this, reducing references and dynamic borrow checks to 0!\n\nSince all operations result in exactly 1 child, we can always move the gradient tape to the child of the last operation. Additionally, no model parameters (all tensors) will ever own the gradient tape because they will never be the result of any operation. This means we know exactly which tensor owns the gradient tape, and the tensors that have it will always be intermediate results that don't need to be maintained across gradient computation.\n\n*All of this together gives users unprecedented control\u002Fprecision over what tensors are recorded on the gradient tape!*\n\nOne advanced use case requires that tensors be re-used multiple times in a computation graph.\nThis can be handled by cloning the tensor, and manually moving the gradient tape around.\n\n### Type checked backward\n\ntl;dr: If you forget to include a call to `trace()` or `traced()`, the program won't compile!\n\n```diff\n-let pred = module.forward(x);\n+let pred = module.forward(x.traced(grads));\nlet loss = (y - pred).square().mean();\nlet gradients = loss.backward();\n```\n\nSince we know exactly what tensors own the gradient tape, we can require the tensor passed into `.backward()` to own the gradient tape!\nAnd further, we can require it be moved into `.backward()`, so it can destruct the tape and construct the gradients!\n\n__All of this can be checked at compile time 🎉__\n\n### 📄 Validated against pytorch\n\nAll functions & operations are tested against behavior shown by similar code in pytorch.\n\n# License\n\nDual-licensed to be compatible with the Rust project.\n\nLicensed under the Apache License, Version 2.0 http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0 or the MIT license http:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT, at your option. This file may not be copied, modified, or distributed except according to those terms.\n","# dfdx: 在 Rust 中进行形状检查的深度学习\n\n[![](https:\u002F\u002Fdcbadge.vercel.app\u002Fapi\u002Fserver\u002FAtUhGqBDP5)](https:\u002F\u002Fdiscord.gg\u002FAtUhGqBDP5)\n[![crates.io](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fv\u002Fdfdx?style=for-the-badge)](https:\u002F\u002Fcrates.io\u002Fcrates\u002Fdfdx)\n[![docs.rs](https:\u002F\u002Fimg.shields.io\u002Fdocsrs\u002Fdfdx?label=docs.rs%20latest&style=for-the-badge)](https:\u002F\u002Fdocs.rs\u002Fdfdx)\n\n\n专注于易用性和安全性的 Rust 深度学习框架。\n\n**目前仍处于预 Alpha 阶段。接下来的几个版本预计会引入破坏性变更。**\n\n主要特性概览：\n1. :fire: GPU 加速张量库，支持高达 6 维的形状！\n2. 支持编译时和运行时均可变的维度形状。（例如 `Tensor\u003C(usize, Const\u003C10>)>` 和 `Tensor\u003CRank2\u003C5, 10>>`）\n3. 丰富的张量操作库（包括矩阵乘法、二维卷积等）。\n    1. 所有张量操作在编译时都会进行形状和类型检查！！\n4. 易用的神经网络构建模块（如全连接层、二维卷积层和 Transformer）。\n5. 常用的深度学习优化器，如 SGD、Adam、AdamW、RMSprop 等。\n\n`dfdx` 已发布在 [crates.io](https:\u002F\u002Fcrates.io\u002Fcrates\u002Fdfdx) 上！只需将以下内容添加到你的 `Cargo.toml` 文件中即可使用：\n\n```toml\ndfdx = \"0.13.0\"\n```\n\n更多文档请访问 [docs.rs\u002Fdfdx](https:\u002F\u002Fdocs.rs\u002Fdfdx)。\n\n[1] https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAutomatic_differentiation#Reverse_accumulation\n\n## 设计目标\n\n1. 全面关注易用性（包括前端接口和内部实现）。\n2. 尽可能在编译时完成所有检查（即如果存在错误，则无法编译）。\n3. 最大化性能。\n4. 尽量减少不安全代码[1]\n5. 减少内部代码中 `Rc\u003CRefCell\u003CT>>` 的使用[2]\n\n[1] 目前仅有的不安全调用是用于矩阵乘法的操作。\n\n[2] 唯一使用 `Arc` 的地方是存储张量数据的部分。采用 `Arc` 而不是 `Box` 是为了减少张量克隆时的内存分配。\n\n## 使用 CUDA 进行 GPU 加速\n\n启用 `cuda` 功能即可开始使用 `Cuda` 设备！需要安装 NVIDIA 的 CUDA 工具包。更多信息请参阅 [功能标志文档](https:\u002F\u002Fdocs.rs\u002Fdfdx\u002Flatest\u002Fdfdx\u002Ffeature_flags\u002Findex.html)。\n\n## API 预览\n\n更多详细信息请查看 [examples\u002F](examples\u002F) 目录。\n\n1. 👌 简单的神经网络 API，完全在编译时进行形状检查。\n\n```rust\ntype Mlp = (\n    (Linear\u003C10, 32>, ReLU),\n    (Linear\u003C32, 32>, ReLU),\n    (Linear\u003C32, 2>, Tanh),\n);\n\nfn main() {\n    let dev: Cuda = Default::default(); \u002F\u002F 或 `Cpu`\n    let mlp = dev.build_module::\u003CMlp, f32>();\n    let x: Tensor\u003CRank1\u003C10>, f32, Cpu> = dev.zeros();\n    let y: Tensor\u003CRank1\u003C2>, f32, Cpu> = mlp.forward(x);\n    mlp.save(\"checkpoint.npz\")?;\n}\n```\n\n2. 📈 易用的优化器 API\n\n```rust\ntype Model = ...\nlet mut model = dev.build_module::\u003CModel, f32>();\nlet mut grads = model.alloc_grads();\nlet mut sgd = Sgd::new(&model, SgdConfig {\n    lr: 1e-2,\n    momentum: Some(Momentum::Nesterov(0.9))\n});\n\nlet loss = ...\ngrads = loss.backward();\n\nsgd.update(&mut model, &grads);\n```\n\n3. 💡 常量张量可以与普通的 Rust 数组相互转换\n```rust\nlet t0: Tensor\u003CRank0, f32, _> = dev.tensor(0.0);\nassert_eq!(t0.array(), &0.0);\n\nlet t1 \u002F*: Tensor\u003CRank1\u003C3>, f32, _>*\u002F = dev.tensor([1.0, 2.0, 3.0]);\nassert_eq!(t1.array(), [1.0, 2.0, 3.0]);\n\nlet t2: Tensor\u003CRank2\u003C2, 3>, f32, _> = dev.sample_normal();\nassert_ne!(t2.array(), [[0.0; 3]; 2]);\n```\n\n## 有趣或值得注意的实现细节\n\n### 模块\n\n```rust\npub trait Module\u003CInput> {\n    type Output;\n    fn forward(&self, input: Input) -> Self::Output;\n}\n```\n\n通过这一灵活的特质，我们实现了：\n1. 单个输入和批量输入（只需提供多个实现即可！）\n2. 多个输入\u002F输出（多头模块或 RNN）\n3. 当梯度记录带存在与否时表现出不同的行为（这不同于其他库中的 `.train()` 和 `.eval()` 行为）！\n\n### 元组表示前馈（即顺序）模块\n\n由于我们可以为元组实现特质——据我所知，这是其他语言所不具备的——因此它们为按顺序执行模块提供了非常友好的前端接口。\n\n```rust\n\u002F\u002F 不知道你为什么要这么做，但确实可以！\ntype Model = (ReLU, Sigmoid, Tanh);\nlet model = dev.build_module::\u003CModel, f32>();\n```\n\n```rust\ntype Model = (Linear\u003C10, 5>, Tanh)\nlet model = dev.build_module::\u003CModel, f32>();\n```\n\n为 2 元组实现 `Module` 接口的方式如下：\n```rust\nimpl\u003CInput, A, B> Module\u003CInput> for (A, B)\nwhere\n    Input: Tensor,\n    A: Module\u003CInput>,        \u002F\u002F A 是一个接受 Input 的模块\n    B: Module\u003CA::Output>,    \u002F\u002F B 是一个接受 A 输出的模块\n{\n    type Output = B::Output; \u002F\u002F 输出是 B 的输出\n    fn forward(&self, x: Input) -> Self::Output {\n        let x = self.0.forward(x);\n        let x = self.1.forward(x);\n        x\n    }\n}\n```\n\n我们已经为最多 6 元素的元组实现了模块，而且你可以任意嵌套它们！\n\n### 不使用 `Rc\u003CRefCells\u003CT>>` —— 梯度记录带并不保存在引用单元中！\n\n其他实现可能会直接将梯度记录带的引用存储在张量上，这就需要频繁地修改张量或大量使用 `Rc`\u002F`RefCell`。\n\n而我们则找到了一种优雅的方法来避免这种情况，将引用和动态借用检查降至零！\n\n由于所有操作都恰好产生一个子节点，我们可以始终将梯度记录带移动到最后一个操作的子节点上。此外，任何模型参数（即所有张量）都不会拥有梯度记录带，因为它们永远不会成为任何操作的结果。这意味着我们可以准确地知道哪个张量拥有梯度记录带，而拥有它的张量总是中间结果，无需在整个梯度计算过程中一直保留。\n\n*这一切共同赋予用户对哪些张量会被记录在梯度记录带上前所未有的控制力和精确度！*\n\n一个高级用例要求在计算图中多次重复使用同一个张量。这可以通过克隆该张量并手动移动梯度记录带来实现。\n\n### 类型检查的反向传播\n\n简而言之：如果你忘记调用 `trace()` 或 `traced()`，程序将无法编译！\n\n```diff\n-let pred = module.forward(x);\n+let pred = module.forward(x.traced(grads));\nlet loss = (y - pred).square().mean();\nlet gradients = loss.backward();\n```\n\n由于我们确切地知道哪个张量拥有梯度记录带，因此我们可以要求传递给 `.backward()` 方法的张量必须拥有梯度记录带！更进一步，我们还可以要求将其移入 `.backward()` 方法中，以便销毁梯度记录带并计算梯度！\n\n__所有这些都可以在编译时进行检查 🎉__\n\n### 📄 与 PyTorch 对照验证\n\n所有函数和操作都经过测试，确保其行为与 PyTorch 中类似代码的行为一致。\n\n# 许可证\n\n双重许可，以兼容 Rust 项目。\n\n根据您的选择，本软件可根据 Apache License, Version 2.0 http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0 或 MIT 许可证 http:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT 进行授权。除非按照这些条款的规定，否则不得复制、修改或分发本文件。","# dfdx 快速上手指南\n\ndfdx 是一个专注于**人体工学**与**安全性**的 Rust 深度学习库。其核心特色是在**编译期进行严格的形状检查**（Shape Checked），确保张量维度不匹配时无法通过编译，同时支持 GPU 加速。\n\n> **注意**：目前该项目处于 pre-alpha 阶段，后续版本可能会包含破坏性更新。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**：Linux, macOS, Windows\n- **编译器**：最新稳定版 Rust (`rustc`)\n- **构建工具**：`cargo`\n\n### 前置依赖\n- **CPU 模式**：无额外依赖，开箱即用。\n- **GPU 模式 (CUDA)**：\n  - 需安装 NVIDIA CUDA Toolkit。\n  - 确保显卡驱动支持对应的 CUDA 版本。\n\n## 安装步骤\n\n在你的 Rust 项目目录中，编辑 `Cargo.toml` 文件添加依赖。\n\n### 1. 基础安装 (CPU)\n```toml\n[dependencies]\ndfdx = \"0.13.0\"\n```\n\n### 2. 启用 GPU 加速 (可选)\n若需使用 CUDA 加速，请启用 `cuda` 特性：\n```toml\n[dependencies]\ndfdx = { version = \"0.13.0\", features = [\"cuda\"] }\n```\n\n> **国内加速建议**：如果下载 crates.io 依赖较慢，可配置国内镜像源。在 `~\u002F.cargo\u002Fconfig.toml` 中添加：\n> ```toml\n> [source.crates-io]\n> replace-with = 'ustc'\n> \n> [source.ustc]\n> registry = \"sparse+https:\u002F\u002Fmirrors.ustc.edu.cn\u002Fcrates.io-index\u002F\"\n> ```\n\n## 基本使用\n\ndfdx 的核心优势在于利用 Rust 类型系统在编译期检查神经网络结构。以下示例展示了一个简单的多层感知机 (MLP) 的构建、前向传播及优化器使用流程。\n\n### 1. 定义模型与前向传播\n\n通过元组 (Tuple) 定义序列模型，利用泛型指定输入输出维度，编译器将自动检查形状匹配。\n\n```rust\nuse dfdx::prelude::*;\nuse dfdx::nn::{Linear, ReLU, Tanh};\n\n\u002F\u002F 定义模型结构：(Input:10 -> Hidden:32) -> ReLU -> (Hidden:32 -> Hidden:32) -> ReLU -> (Hidden:32 -> Output:2) -> Tanh\ntype Mlp = (\n    (Linear\u003C10, 32>, ReLU),\n    (Linear\u003C32, 32>, ReLU),\n    (Linear\u003C32, 2>, Tanh),\n);\n\nfn main() -> Result\u003C(), Box\u003Cdyn std::error::Error>> {\n    \u002F\u002F 选择设备：Cuda (需开启 cuda 特性) 或 Cpu\n    let dev: Cpu = Default::default(); \n    \n    \u002F\u002F 构建模型\n    let mlp = dev.build_module::\u003CMlp, f32>();\n    \n    \u002F\u002F 创建输入张量 (形状为 [10])\n    let x: Tensor\u003CRank1\u003C10>, f32, Cpu> = dev.zeros();\n    \n    \u002F\u002F 前向传播 (形状在编译期已检查，输出形状自动推导为 [2])\n    let y: Tensor\u003CRank1\u003C2>, f32, Cpu> = mlp.forward(x);\n    \n    println!(\"Output shape is checked at compile time!\");\n    \n    \u002F\u002F 保存模型\n    \u002F\u002F mlp.save(\"checkpoint.npz\")?; \n    \n    Ok(())\n}\n```\n\n### 2. 使用优化器训练\n\ndfdx 提供了类型安全的反向传播机制。必须显式调用 `.traced()` 将张量加入梯度磁带，否则无法编译。\n\n```rust\nuse dfdx::prelude::*;\nuse dfdx::optim::{Sgd, SgdConfig, Momentum};\n\n\u002F\u002F 假设 Model 已定义\ntype Model = (Linear\u003C10, 2>, ReLU); \n\nfn train_step() -> Result\u003C(), Box\u003Cdyn std::error::Error>> {\n    let dev: Cpu = Default::default();\n    let mut model = dev.build_module::\u003CModel, f32>();\n    \n    \u002F\u002F 分配梯度存储\n    let mut grads = model.alloc_grads();\n    \n    \u002F\u002F 初始化优化器 (例如带动量的 SGD)\n    let mut sgd = Sgd::new(&model, SgdConfig {\n        lr: 1e-2,\n        momentum: Some(Momentum::Nesterov(0.9))\n    });\n\n    \u002F\u002F 模拟数据\n    let x: Tensor\u003CRank1\u003C10>, f32, _> = dev.sample_normal();\n    let y: Tensor\u003CRank1\u003C2>, f32, _> = dev.sample_normal();\n\n    \u002F\u002F 关键步骤：必须使用 .traced(grads) 包裹输入，才能进行反向传播\n    \u002F\u002F 如果忘记此步，代码将无法通过编译\n    let pred = model.forward(x.traced(grads));\n    \n    \u002F\u002F 计算损失\n    let loss = (y - pred).square().mean();\n    \n    \u002F\u002F 反向传播：消耗 loss 张量并生成梯度\n    let gradients = loss.backward();\n    \n    \u002F\u002F 更新模型参数\n    sgd.update(&mut model, &gradients);\n\n    Ok(())\n}\n```\n\n### 3. 张量与数组互转\n\n对于编译期已知形状的张量（Const tensors），可以直接与 Rust 原生数组互换。\n\n```rust\nlet dev: Cpu = Default::default();\n\n\u002F\u002F 标量\nlet t0: Tensor\u003CRank0, f32, _> = dev.tensor(0.0);\nassert_eq!(t0.array(), &0.0);\n\n\u002F\u002F 一维向量\nlet t1: Tensor\u003CRank1\u003C3>, f32, _> = dev.tensor([1.0, 2.0, 3.0]);\nassert_eq!(t1.array(), [1.0, 2.0, 3.0]);\n\n\u002F\u002F 二维矩阵\nlet t2: Tensor\u003CRank2\u003C2, 3>, f32, _> = dev.sample_normal();\n\u002F\u002F 获取原生数组 [[f32; 3]; 2]\nlet arr = t2.array(); \n```","某嵌入式系统团队正在为工业传感器开发一套基于 Rust 的实时异常检测模型，需在资源受限的边缘设备上保证极高的运行稳定性。\n\n### 没有 dfdx 时\n- **运行时崩溃风险高**：传统动态张量库无法在编译期发现维度不匹配（如矩阵乘法行列不对应），导致模型在生产环境偶发 Panic。\n- **调试成本高昂**：形状错误往往要在数据流经多层网络后才暴露，开发者需花费大量时间追踪源头。\n- **内存管理复杂**：为避免性能损耗常需手动管理内存或使用不安全代码块，增加了维护难度和潜在漏洞。\n- **重构信心不足**：修改网络结构（如调整隐藏层大小）时，缺乏编译器辅助检查，不敢轻易变动核心逻辑。\n\n### 使用 dfdx 后\n- **编译期杜绝维度错误**：利用 Rust 类型系统，将张量形状（如 `Tensor\u003CRank2\u003C5, 10>>`）纳入类型检查，维度不匹配直接导致编译失败，彻底消除运行时形状异常。\n- **错误定位即时化**：一旦接口定义与数据形状不符，IDE 立即报错，开发者在编码阶段即可修复，无需等待运行测试。\n- **安全且高性能**：dfdx 最大化减少 unsafe 代码和运行时引用计数开销，在提供 GPU 加速的同时，确保内存安全符合嵌入式严苛标准。\n- **重构轻松自如**：调整网络层级只需修改类型定义（如更改 `Linear\u003C10, 32>` 中的参数），编译器会自动验证全链路连通性，让架构迭代更安心。\n\ndfdx 通过将深度学习中的形状校验前置到编译阶段，让 Rust 在边缘 AI 场景中真正实现了“既快又稳”的落地价值。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fchelsea0x3b_dfdx_85fd57ef.png","chelsea0x3b","Chelsea Lowman","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fchelsea0x3b_62781abc.jpg",null,"Lambda, Inc.","clowman1993@gmail.com","https:\u002F\u002Fgithub.com\u002Fchelsea0x3b",[22,26,30,34],{"name":23,"color":24,"percentage":25},"Rust","#dea584",92.1,{"name":27,"color":28,"percentage":29},"Cuda","#3A4E3A",7.6,{"name":31,"color":32,"percentage":33},"GLSL","#5686a5",0.3,{"name":35,"color":36,"percentage":37},"WGSL","#1a5e9a",0,1902,104,"2026-04-02T14:27:31","NOASSERTION",4,"未说明","可选。若启用 CUDA 加速，需要安装 NVIDIA CUDA Toolkit，具体显卡型号、显存大小及 CUDA 版本未在文档中明确指定。",{"notes":46,"python":47,"dependencies":48},"这是一个基于 Rust 的深度学习库，而非 Python 库。目前处于 pre-alpha（预测试）阶段，后续版本可能会包含破坏性更新。默认支持 CPU，如需 GPU 加速需在 Cargo.toml 中启用 'cuda' 特性并安装 NVIDIA CUDA Toolkit。该库强调编译时的形状检查和安全性和性能，尽量减少 unsafe 代码的使用。","不需要 (基于 Rust)",[49,50],"Rust (Cargo)","NVIDIA CUDA Toolkit (仅 GPU 模式)",[52],"开发框架",[54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72],"rust","autograd","autodiff","machine-learning","neural-network","autodifferentiation","rust-lang","backpropagation","tensor","deep-learning","deep-neural-networks","cuda","cuda-kernels","cuda-support","cuda-toolkit","gpu","gpu-acceleration","gpu-computing","cudnn",2,"ready","2026-03-27T02:49:30.150509","2026-04-06T07:16:15.433776",[78,83,88,93,98,103],{"id":79,"question_zh":80,"answer_zh":81,"source_url":82},12403,"梯度累积过程中出现内存不足（OOM）问题，临时梯度是否会被自动释放？","是的，临时梯度会在 `Gradients` 对象被丢弃（dropped）时自动释放。如果您希望更精细地管理内存，可以采用用户手动管理梯度的方式：只将已分配梯度的可变引用传递给 `trace()` 函数。即使发生错误导致梯度超出作用域，Rust 的机制也会确保它们被正确释放。","https:\u002F\u002Fgithub.com\u002Fchelsea0x3b\u002Fdfdx\u002Fissues\u002F523",{"id":84,"question_zh":85,"answer_zh":86,"source_url":87},12404,"如何在 dfdx 中构建具有多个输入或多个输出的神经网络？","多输出可以通过 `SplitInto` 轻松实现。对于多输入，可以使用 `AddInto` 将所有输入张量的值相加合并为一个张量。如果在使用 `SplitInto` 时遇到 panic（例如因 unwrap None 导致），请检查网络定义是否正确，近期更新已修复了相关的全网络支持问题。","https:\u002F\u002Fgithub.com\u002Fchelsea0x3b\u002Fdfdx\u002Fissues\u002F253",{"id":89,"question_zh":90,"answer_zh":91,"source_url":92},12405,"在不同矩阵乘法后端（如 AMD no-features, threaded-cpu, Intel MKL）下，为什么会出现微小的损失值差异？","这种微小的差异通常是由于底层架构依赖性或浮点数舍入误差造成的，属于正常现象。不同的后端（如 `threaded-cpu` 或 `intel-mkl`）可能使用不同的并行策略或指令集，导致计算结果的最后一位小数略有不同，但这通常不会影响模型的整体收敛和性能。","https:\u002F\u002Fgithub.com\u002Fchelsea0x3b\u002Fdfdx\u002Fissues\u002F560",{"id":94,"question_zh":95,"answer_zh":96,"source_url":97},12406,"如何在 dfdx 中启用和使用 CUDA GPU 支持？","要启用 GPU 支持，需要添加 `Cuda` 设备（包装 `cudarc::CudaDevice`）。在测试中，可以通过基于 feature 的设备构建（例如使用 `#[cfg(feature=\"test-cuda\")]`）来切换 CPU 和 CUDA 后端。目前所有主要测试在 `Cuda` 和 `Cpu` 设备上均已通过。对于自定义操作，直接分配 `CudaSlice` 并编写自定义内核往往比集成完整的 cudnn 更简单。","https:\u002F\u002Fgithub.com\u002Fchelsea0x3b\u002Fdfdx\u002Fissues\u002F9",{"id":99,"question_zh":100,"answer_zh":101,"source_url":102},12407,"在实现 Transformer 架构时遇到类型系统限制（如 where 子句循环检测或 ConstEq 问题）该如何解决？","如果在自注意力机制的前向函数中使用 where 子句指定元素数量相等时遇到“cycle detected”错误，可以尝试使用宏来实现具体的逻辑，或者用 `Assert\u003C>` 替代 `ConstEq`。此外，有时可以通过 `reshape` 操作达到类似 `reshape + transpose` 的效果，从而避免实现复杂的转置逻辑。","https:\u002F\u002Fgithub.com\u002Fchelsea0x3b\u002Fdfdx\u002Fissues\u002F34",{"id":104,"question_zh":105,"answer_zh":106,"source_url":92},12408,"如何在 no-std 环境下测试和编译 dfdx？","在 no-std 环境下，不需要 CUDA 支持。可以通过运行 `cargo test --tests` 并在不同场景下验证编译情况。注意，某些最近的功能可能破坏了 no-std 支持（例如 CPU 设备上依赖 `Vec`, `String` 等 std 特性），因此需要确保移除了对 std 的隐式依赖。建议使用 `cargo tree` 检查依赖项，并将 `std = [..., \"matrixmultiply?\u002Fstd\"]` 的配置调整纳入 PR 以修复兼容性问题。",[108,113,118,123,128,133,138,143],{"id":109,"version":110,"summary_zh":111,"released_at":112},62742,"v0.13.0","## 变更内容\n* 将 `storage_traits::TensorToArray` 设为公有，由 AndrejOrsula 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F817 中完成\n* accurate-gelu，由 jcrist1 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F813 中完成\n* 修复 examples\u002F04-gradients.rs，由 coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F824 中完成\n* 将优化核函数移至张量操作中，由 coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F828 中完成\n* 【破坏性变更】添加了 `AMP\u003CF>` 数据类型，由 coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F811 中完成\n* 为 dtypes 模块和 amp 添加文档，由 coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F834 中完成\n\n## 新贡献者\n* @AndrejOrsula 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F817 中完成了首次贡献\n* @jcrist1 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F813 中完成了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fcompare\u002Fv0.12.1...v0.13.0","2023-07-27T13:15:10",{"id":114,"version":115,"summary_zh":116,"released_at":117},62743,"v0.12.1","## 变更内容\n* 通过 #799，允许模型实现向后兼容，由 @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F808 中完成\n* 各种小修复，由 @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F814 中完成\n* 将所有形状特征公开，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F816 中完成\n\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fcompare\u002Fv0.12.0...v0.12.1","2023-07-14T17:01:50",{"id":119,"version":120,"summary_zh":121,"released_at":122},62744,"v0.12.0","## 破坏性变更\n\n* [破坏性] 添加 Tensor::try_realize，且 Tensor::realize 不再返回 Result 类型，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F758 中实现\n* [破坏性] ReshapeTo::reshape_like 和 ReshapeTo::try_reshape_like 现在会 panic，而不是返回 Option，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F766 中实现\n* [破坏性] 为 Conv2D 添加 dilation\u002Fgroups 参数。同时为 Pool2D 添加 dilation 参数，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F767 中实现\n* [破坏性] 使用 `gemm` 实现矩阵乘法。移除对 matrixmultiply 和 MKL 的支持，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F776 中实现\n* [破坏性] 将存储 GAT 提升至 trait 层次的泛型。将 DeviceStorage 拆分为多个 trait，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F782 中实现\n* [破坏性] 为 ConvTranspose2D 添加 dilation\u002Fgroups 参数，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F783 中实现\n\n## 变更内容\n\n* 添加 f16 作为 Dtype，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F696 中实现\n* 添加示例，由 @sirandreww 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F740 中实现\n* 添加 TryConcatAlong，以支持沿任意轴进行拼接，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F750 中实现\n* 修改 compatibility.cuh 中的 CUDA_ARCH 宏，由 @jafioti 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F752 中实现\n* 允许 `broadcast_like` 接受张量或形状，由 @VasanthakumarV 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F751 中实现\n* 移除 build.rs 对输出目录的重新运行逻辑，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F754 中实现\n* 修复针对计算能力 70-75 的兼容性问题，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F757 中实现\n* 向 Device bound 添加 TriangleTensor 和 CmpKernel trait，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F760 中实现\n* 在 dropout 中使用伯努利分布——这使得 dropout 在不同 dtype 下具有可重复性，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F761 中实现\n* 修复 f16 平均值中的 bug：当元素数量减少时，结果会变为 f16::INF，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F763 中实现\n* 占位符式的 f16 gemm 加速，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F765 中实现\n* MultiHeadAttention 的 3D 实现现在会广播到 4D，而不是重复逻辑，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F768 中实现\n* 将 `cudarc?\u002Ff16` 放置在 `f16` feature 之后，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F774 中实现\n* 为 Adam、SGD 和 RMSprop 实现 Clone trait，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F775 中实现\n* 正确设置前向和反向传播中 gemm 的 read_dst，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F777 中实现\n* 添加 rayon 依赖，并使用 `gemm::Parallelism::Rayon(rayon::current_num_threads())`，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F778 中实现\n* 添加 LogSoftmax，由 @kurnevsky 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F769 中实现\n* 将部分测试从 nightly 切换到稳定版，并为 conv2d 操作添加文档，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx 中实现","2023-07-11T13:39:01",{"id":124,"version":125,"summary_zh":126,"released_at":127},62745,"v0.11.2","## 变更内容\n* 由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F680 中简化了上采样 CUDA 内核\n* 由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F684 中实现了栈操作和拼接操作的 CUDA 内核 JIT 编译\n* 由 @quietlychris 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F685 中初步合并了 nvidia-smi 和 nvcc 的检查\n* 功能：在适当的时候使用 `Cow`，由 @Alexandcoats 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F688 中实现\n* 向 `launch_cfg` 添加常量泛型参数 `NUM_THREADS`，由 @VasanthakumarV 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F691 中完成\n* 功能：添加 `Tensorlike` 接口以清理遗留问题，由 @Alexandcoats 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F689 中实现\n* 添加 `contiguous` 和 `try_contiguous` 方法，由 @VasanthakumarV 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F690 中完成\n* （功能）添加设备访问方法，由 @ccaven 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F692 中实现\n* 向 `examples\u002F02-ops.rs` 添加运行时维度示例，由 @VasanthakumarV 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F698 中完成\n* 防止对 `sum_to` 的广播输出进行过度分配，由 @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F699 中实现\n* 为张量分配添加缓存层，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F670 中完成\n* 处理 `build.rs` 中的 `\\r` 字符，由 @ViliamVadocz 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F702 中实现\n* 默认禁用缓存，并添加 `enable_cache()` 方法，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F704 中完成\n* 修正 `feature_flags.rs` 中的拼写错误，由 @mauvray 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F710 中完成\n* 为矩阵乘法添加 `(mat * vec)` 实现，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F716 中完成\n* 为测试添加更好的断言宏，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F714 中完成\n* 将多个 GitHub 工作流合并以供复用，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F717 中完成\n* 将 `nn ToDtype` 改为在方法中使用泛型，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F719 中完成\n* `Flatten2D` 现在接受通用的批次维度，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F720 中完成\n* 在可能的情况下，为标量二元运算使用 `impl Into\u003CE>`，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F722 中完成\n* 在特性标志中添加 cuDNN 部分，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F723 中完成\n* 为 `(T,)` 类型添加实现，由 @opfromthestart 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F725 中完成\n* 修复 no-std 模式的依赖关系，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F736 中完成\n* 将 Rust 1.65 设置为最低支持的 Rust 编译器版本，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F737 中完成\n* 将标量比较改为与张量比较使用相同的方法，废弃 `try_scalar_*` 和 `scalar_*`，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F738 中完成\n* 运行适用于所有推送类型的 CI 流水线——而不仅限于拉取请求相关的推送，由 @YannickFricke 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F739 中完成\n* 添加 `Tensor::to_device` 方法，以支持将任意形状的张量发送到任意设备","2023-04-27T12:41:27",{"id":129,"version":130,"summary_zh":131,"released_at":132},62746,"v0.11.1","## 变更内容\n* 修复 gather CUDA 内核中的 bug，由 @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F588 中完成\n* 功能（设备）：引入 AutoDevice 类型，由 @kakoc 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F579 中完成\n* 使用递归宏实现形状操作特性，由 @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F583 中完成\n* 添加 ToDtype 张量操作，由 @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F582 中完成\n* 默认为 CUDA 内核使用 128 个线程，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F599 中完成\n* 添加 Slice 张量操作，由 @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F602 中完成\n* 对卷积内核进行小幅优化，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F605 中完成\n* 功能：添加上三角和下三角（tril 和 triu）分配，由 @Alexandcoats 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F568 中完成\n* 添加 Tensor::roll 操作，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F608 中完成\n* 在 CUDA 下使用多流进行矩阵乘法，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F610 中完成\n* 修复 no-std 支持问题，由 @Alexandcoats 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F615 中完成\n* 将 matrixmultiply\u002Fstd 添加到 std 功能中，由 @kstavro 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F618 中完成\n* 实现 usize 数组的 concat；将 concat 添加到 Device 中，由 @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F621 中完成\n* 允许 conv2d 和 pool2d 使用宽度和高度的动态维度，由 @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F620 中完成\n* 切换到使用 nvcc --list-gpu-code 来获取 build.rs 的 compute_cap，由 @quietlychris 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F619 中完成\n* 修复 CUDA 上 reshape 的 bug，由 @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F622 中完成\n* 不再始终在 pool_global.rs 中执行 try_min 操作，由 @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F623 中完成\n* 撤销“切换到使用 nvcc --list-gpu-code 来获取 build.rs 的 compute_cap…”的更改，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F624 中完成\n* 添加 `restrided`，以取代 `get_unstrided_index` -> `get_strided_index`，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F628 中完成\n* 将多次调用 get_strided_index 合并为一个循环，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F629 中完成\n* 减少某些操作向 CUDA 发送的缓冲区数量，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F611 中完成\n* 进一步优化 conv2d，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F631 中完成\n* 添加支持包含较小的最后一个批次的功能，由 @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F632 中完成\n* Upscale2D 和 ConvTrans2d，由 @opfromthestart 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F603 中完成\n* 为除 bool 外的所有 Unit 类型实现 Dtype，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F635 中完成\n* 允许 convtrans2d 使用动态维度，由 @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F639 中完成\n* 为 to_dtype 和 reshape JIT 编译内核，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F634 中完成\n* 优化转置卷积","2023-04-08T16:05:35",{"id":134,"version":135,"summary_zh":136,"released_at":137},62747,"v0.11.0","## 变更内容\n* @Dimev 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F256 中添加了 AddInto\n* @M1ngXU 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F283 中添加了 5 维和 6 维张量\n* @M1ngXU 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F282 中移除了 phantom\n* @Dimev 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F297 中移除了张量的边界限制\n* @JYudelson1 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F294 中将 nightly 添加到 cargo-test\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F304 中重构了 Devices\u002FDyn 维度\n* @infalmo 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F310 中添加了运行 mnist 示例的说明\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F315 中移除了 Dyn，直接使用 usize\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F316 中将 Tensor 的默认 dtype 设置为 f32，并更新了示例和文档字符串\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F317 中仅在推送时运行 GitHub Actions\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F313 中添加了 Unit 和 HasUnitType，并减少了 Dtype 的约束\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F324 中移除了 build_test_device，统一使用 TestDevice\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F327 中添加了 SampleTensor，移除了 RandTensor 和 RandnTensor\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F328 中移除了张量别名的用法\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F329 中将 intel-mkl 相关代码移至 build.rs 的子模块\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F322 中添加了 Cuda 设备和 Cuda 内核的框架实现\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F331 中实现了 abs、exp、div 和 sum_to 的 Cuda 内核\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F343 中实现了 permute_to 和 broadcast_to 的 Cuda 内核\n* @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F346 中为 #341 和 #334 中的二元张量操作添加了 Cuda 实现\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F350 中在二元运算的反向传播中使用 atomicAdd，以正确处理步幅\n* @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F354 中解决了 #352 和 #347 问题\n* @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F356 中实现了 reshape 的 Cuda 内核（解决 #336）\n* @ViliamVadocz 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F358 中为 Transformer 测试添加了缺失的设备泛型\n* @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F359 中添加了 select 和 gather 的 Cuda 内核\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F361 中升级到了 cudarc 0.6.0\n* @nkoppel 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F357 中为二元广播加法添加了测试，并修复了相关 bug 以使测试通过\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F364 中在 pull_request 上运行 GitHub Actions\n* @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F342 中实现了 matmul 的 Cuda 内核\n* @ 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F 中添加了动态示例。","2023-03-16T17:51:18",{"id":139,"version":140,"summary_zh":141,"released_at":142},62748,"v0.10.0","## 变更内容\n\n### 重大变更\n\n* 二元运算（`add`、`sub`、`div`、`mul`、`maximum`、`minimum`）现在会获取右操作数的所有权，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F268 中实现。\n* `backwards` 现在仅支持 0 维张量，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F206 中实现。\n* `Clone` 现在会保留相同的 ID，移除了 `Tensor::duplicate` 方法，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F249 中实现。\n* 多轴归约\n    * 详见 [文档](https:\u002F\u002Fdocs.rs\u002Fdfdx\u002F0.10.0\u002Fdfdx\u002Ftensor_ops\u002Findex.html#reductions)\n    * https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F189、https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F190、https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F194\n    * 归约函数现在可以沿任意轴或多个轴进行归约：`mean`、`sum`、`max`、`min`、`stddev`、`var`、`softmax`、`log_softmax` 和 `logsumexp`。\n    * 移除 `-1` 作为有效轴索引，并引入 `trait HasLastAxis` 以替代它用于泛型函数中。\n    * 新增 `normalize` 函数，可在任意轴上进行归一化。\n    * 移除单轴归约函数 `fn *_axis()`：`mean_axis`、`sum_axis`、`max_axis`、`min_axis`、`normalize_axis`、`std_axis`、`var_axis`。\n    * 将 `HasAxis` 重命名为 `HasAxes`。\n    * 新增 `trait BroadcastTo`：\n        * 移除 `trait Broadcast1`、`trait Broadcast2`、`trait Broadcast3`、`trait Broadcast4`。\n    * 新增 `trait Reduce`\u002F`trait ReduceTo`：\n        * 移除 `trait Reduce1`。\n* 批量选择与选择一致性\n    * 详见 [文档](https:\u002F\u002Fdocs.rs\u002Fdfdx\u002F0.10.0\u002Fdfdx\u002Ftensor_ops\u002Findex.html#selectsindexing)\n    * 重命名 `SelectTo`，并在批量选择中使用 `SelectTo`，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F217 中实现。\n    * 为设备和 tensor_ops 添加批量选择功能，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F182 中实现。\n* 在预导模块中简化内容，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F209 中实现。\n* 将 `FlattenImage` 重命名为 `Flatten2D`，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F243 中实现。\n\n### 新特性\n\n* 张量中使用 `Arc` 替代 `Rc`，由 @caelunshun 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F236 中实现。\n* 新增 `powi()` 和 `powf()` 函数，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F167 中实现。\n* 支持 `no_std`\n    * 详见 [特性标志文档](https:\u002F\u002Fdocs.rs\u002Fdfdx\u002F0.10.0\u002Fdfdx\u002Ffeature_flags\u002Findex.html)\n    * 移除 `num-traits`，并将依赖项的默认特性设置为关闭，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F200 中实现。\n    * 新增 `intel-mkl` 特性，并移除原有的 4 个 `mkl-*-*` 特性，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F239 中实现。\n    * 新增一个包含特性标志文档的模块，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F240 中实现。\n    * 新增 `numpy` 特性，使 `numpy` 和 `npz` 成为可选依赖，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F241 中实现。\n    * 通过 `no_std_compat` 实现对 `#![no_std]` 的支持，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F244 中实现。\n    * 将依赖项的默认特性设置为关闭，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002F 中实现。","2022-10-30T16:29:26",{"id":144,"version":145,"summary_zh":146,"released_at":147},62749,"v0.9.0","## 破坏性变更\n\n* 添加广播函数、在任意轴上进行约简以及选择子张量功能（#137、#114、#139），由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F138 中实现\n* 增加了归一化轴的功能，并移除了原有的归一化操作，由 @vikigenius 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F140 中完成\n* #67 `Optimizer::update` 现在返回 `Result\u003C(), UnusedParamsError>`，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F107 中实现\n\n## 新特性\n\n* #34 添加 Transformer 模块！！！，由 @jafioti 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F120 中实现\n* #1 添加 Conv2d 层，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F124 中实现\n* #55 添加了 reshape 函数，相关工作由 #90、#129 和 #120 完成\n* #133 添加 FlattenImage 层，该层使用 reshape 实现，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F133 中完成\n* #142 添加 Module::forward_mut 方法，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F148 中实现\n* #80 添加 nn::Softmax 层，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F81 中完成\n* #79 添加 smooth_l1_loss 和 huber_loss 损失函数，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F82 中实现\n* #131 matmul 现在支持批量和广播输入，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F132 中完成\n* 添加 macOS 上的 MKL 支持，由 @yerke 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F73 中实现\n* 添加最大值函数，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F143 中完成\n* 添加 min_axis 函数，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F144 中完成\n\n\n## 其他变更\n\n* 使用 binary_map 简化 BCE 损失的实现，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F75 中完成\n* 各种杂项更新，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F76 中完成\n* 添加自定义模型示例，由 @jafioti 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F83 中完成\n* 为 `NpzError` 添加 Debug 和 Display 支持，由 @XBagon 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F85 中完成\n* 添加 nightly 特性，由 @jafioti 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F89 中完成\n* 添加 2D 的 broadcast_first 函数和 3D 的线性前向传播，由 @jafioti 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F94 中完成\n* #55 的 reshape 工作，以及 #87 对 nightly 特性的进一步完善，均由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F90 中完成\n* #69 添加 map_df_uses_fx 函数，由 @coreylowman 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F105 中完成\n* 修复了一个具有误导性的文档字符串，由 @M1ngXU 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F109 中完成\n* 修复 Issue #110：修正 Dropout（测试）对非正数值的处理问题，由 @M1ngXU 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F113 中完成\n* Issue #96 相关工作，由 @M1ngXU 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F118 中完成\n\n## 新贡献者\n* @jafioti 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F83 中完成了首次贡献\n* @XBagon 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F85 中完成了首次贡献\n* @yerke 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F73 中完成了首次贡献\n* @M1ngXU 在 https:\u002F\u002Fgithub.com\u002Fcoreylowman\u002Fdfdx\u002Fpull\u002F109 中完成了首次贡献\n* @vikigenius 完成了他们的","2022-08-20T17:42:04",[149,160,169,177,185,198],{"id":150,"name":151,"github_repo":152,"description_zh":153,"stars":154,"difficulty_score":155,"last_commit_at":156,"category_tags":157,"status":74},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[52,158,159],"图像","Agent",{"id":161,"name":162,"github_repo":163,"description_zh":164,"stars":165,"difficulty_score":73,"last_commit_at":166,"category_tags":167,"status":74},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,"2026-04-05T11:33:21",[52,159,168],"语言模型",{"id":170,"name":171,"github_repo":172,"description_zh":173,"stars":174,"difficulty_score":73,"last_commit_at":175,"category_tags":176,"status":74},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[52,158,159],{"id":178,"name":179,"github_repo":180,"description_zh":181,"stars":182,"difficulty_score":73,"last_commit_at":183,"category_tags":184,"status":74},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[52,168],{"id":186,"name":187,"github_repo":188,"description_zh":189,"stars":190,"difficulty_score":73,"last_commit_at":191,"category_tags":192,"status":74},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[158,193,194,195,159,196,168,52,197],"数据工具","视频","插件","其他","音频",{"id":199,"name":200,"github_repo":201,"description_zh":202,"stars":203,"difficulty_score":155,"last_commit_at":204,"category_tags":205,"status":74},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[159,158,52,168,196]]