スキル一覧に戻る
johnzfitch

burn-contrib

by johnzfitch

Comprehensive Claude Code plugin for the Burn deep learning framework

1🍴 0📅 2026年1月19日
GitHubで見るManusで実行

SKILL.md


name: burn-contrib description: This skill should be used when the user asks about "contributing to Burn", "adding an operation", "burn internals", "burn-tensor", "burn-autodiff", "ONNX converter", "NodeProcessor", or Burn framework development. version: 0.1.0

Burn Contribution

Knowledge for contributing to the Burn framework itself.

Project Architecture

Burn is organized into crates:

CratePurpose
burn-tensorTensor API and operations
burn-autodiffAutomatic differentiation
burn-wgpuWGPU backend
burn-ndarrayNdArray backend
burn-importONNX/model import
burn-coreCore traits and types
burnUser-facing re-exports

Adding a New Operation

Step 1: burn-tensor

Define the operation API:

// burn-tensor/src/tensor/api/float.rs
impl<B: Backend, const D: usize> Tensor<B, D> {
    pub fn my_op(self, other: Self) -> Self {
        Tensor::new(B::float_my_op(self.primitive, other.primitive))
    }
}

Add backend trait method:

// burn-tensor/src/tensor/backend/base.rs
pub trait Backend {
    fn float_my_op(lhs: FloatTensor<Self>, rhs: FloatTensor<Self>) -> FloatTensor<Self>;
}

Step 2: burn-autodiff

Implement gradient computation:

// burn-autodiff/src/ops/tensor.rs
impl<B: Backend> AutodiffBackend for Autodiff<B> {
    fn float_my_op(lhs: FloatTensor<Self>, rhs: FloatTensor<Self>) -> FloatTensor<Self> {
        // Track operation for backward pass
        // Implement gradient formulas
    }
}

Step 3: Backend Implementations

Implement for each backend (NdArray, WGPU, etc.):

// burn-ndarray/src/ops/tensor.rs
impl Backend for NdArray {
    fn float_my_op(lhs: NdArrayTensor<f32>, rhs: NdArrayTensor<f32>) -> NdArrayTensor<f32> {
        // Actual computation
    }
}

ONNX Converter

Adding support for ONNX operators:

NodeProcessor Trait

impl NodeProcessor for MyOpProcessor {
    fn process(&self, node: &Node, graph: &mut Graph) -> Result<()> {
        // Parse ONNX node attributes
        // Generate Burn operation
    }
}

Registration

Register processor in operator registry:

registry.register("MyOp", Box::new(MyOpProcessor::new()));

Testing

All new operations need tests:

#[test]
fn test_my_op() {
    let tensor1 = TestTensor::from([1.0, 2.0]);
    let tensor2 = TestTensor::from([3.0, 4.0]);
    let result = tensor1.my_op(tensor2);
    result.into_data().assert_approx_eq(&[...], 4);
}

Additional Resources

Consult references/topic-map-contrib.md for:

  • Detailed crate dependency graph
  • Autodiff implementation patterns
  • Backend fusion/JIT integration
  • PR submission guidelines

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です