一键导入
burn-onnx
Burn ONNX support - Import ONNX models into Burn for inference on any backend. Supports compile-time code generation and runtime loading.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Burn ONNX support - Import ONNX models into Burn for inference on any backend. Supports compile-time code generation and runtime loading.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Convert Markdown with LaTeX math, images, and tables into a polished PDF. Two rendering engines: (1) weasyprint — pure Python, no browser needed; (2) chromium — best for matrices/bmatrix/pmatrix/vmatrix and complex formulas. Supports Chinese/Japanese fonts. Can chain after ocr-md-polish for a complete OCR→clean→PDF workflow.
Burn core framework - Provides tensor operations, automatic differentiation, and neural network building blocks for Rust deep learning.
Burn CUDA backend - High-performance NVIDIA GPU acceleration. Provides optimal performance for NVIDIA hardware.
Burn Metal backend - Apple GPU acceleration for macOS and iOS. Optimized for Apple Silicon and Intel-based Macs.
Burn NdArray backend - CPU-based tensor operations using Rust's ndarray crate. Ideal for development, testing, and lightweight inference.
Provides guidance on using Burn deep learning framework for Rust projects. Invoke when working with tensor operations, model inference, or ONNX model integration in Rust.
| name | burn-onnx |
| description | Burn ONNX support - Import ONNX models into Burn for inference on any backend. Supports compile-time code generation and runtime loading. |
burn-onnx enables importing ONNX models into Burn, allowing them to run on any Burn backend (CPU, GPU, WebAssembly).
In build.rs:
use burn_onnx::OnnxCodegen;
fn main() -> Result<(), Box<dyn std::error::Error>> {
OnnxCodegen::new()
.input("model.onnx")
.output("src/model.rs")
.generate()?;
Ok(())
}
In your code:
use burn_ndarray::NdArrayBackend;
mod model;
use model::Model;
let model: Model<NdArrayBackend> = Model::default();
let output = model.forward(input);
use burn_onnx::OnnxModel;
use burn_ndarray::NdArrayBackend;
let model = OnnxModel::<NdArrayBackend>::new("model.onnx");
let output = model.forward(input);
// In build.rs
OnnxCodegen::new()
.input("encoder.onnx")
.output("src/encoder.rs")
.generate()?;
OnnxCodegen::new()
.input("decoder.onnx")
.output("src/decoder.rs")
.generate()?;
[model_exports]
default_backend = "ndarray"
default_device = "Cpu"
[ndarray]
burn-onnx supports common ONNX operators:
| Mode | Performance | Flexibility |
|---|---|---|
| Compile-time | High | Low |
| Runtime | Medium | High |
burn: Core frameworkburn-ndarray: CPU inferenceburn-wgpu: GPU inference