{"record":{"id":"c82e1f5716456f69","repo":"tracel-ai/burn","slug":"unimplemented-float-scatter-with-other-updat","errorCode":null,"errorMessage":"unimplemented!(\"float_scatter with {other:?} update is not implemented\")","messagePattern":"unimplemented!\\(\"float_scatter with (.+?) update is not implemented\"\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-autodiff/src/ops/tensor.rs","lineNumber":1262,"sourceCode":"                            B::float_scatter(\n                                dim,\n                                tensor.primitive,\n                                indices,\n                                value.primitive,\n                                IndexingUpdateOp::Mul,\n                            ),\n                        )\n                    }\n                    OpsKind::UnTracked(prep) => prep.finish(B::float_scatter(\n                        dim,\n                        tensor.primitive,\n                        indices,\n                        value.primitive,\n                        IndexingUpdateOp::Mul,\n                    )),\n                }\n            }\n            other => unimplemented!(\"float_scatter with {other:?} update is not implemented\"),\n        }\n    }\n\n    fn float_scatter_nd(\n        data: FloatTensor<Self>,\n        indices: IntTensor<B>,\n        values: FloatTensor<Self>,\n        reduction: burn_backend::tensor::IndexingUpdateOp,\n    ) -> FloatTensor<Self> {\n        use burn_backend::tensor::IndexingUpdateOp;\n\n        match reduction {\n            IndexingUpdateOp::Add => {\n                #[derive(Debug)]\n                struct ScatterNdAdd;\n\n                impl<B: Backend> Backward<B, 2> for ScatterNdAdd {\n                    type State = IntTensor<B>;","sourceCodeStart":1244,"sourceCodeEnd":1280,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-autodiff/src/ops/tensor.rs#L1244-L1280","documentation":"In the autodiff backend's float_scatter (crates/burn-autodiff/src/ops/tensor.rs:1262), only Add/Sub/Mul update ops are matched for the scatter's IndexingUpdateOp; any other update op falls into the catch-all arm and panics with unimplemented!(\"float_scatter with {other:?} update is not implemented\").","triggerScenarios":"Calling Tensor::scatter with an IndexingUpdateOp other than Add, Sub, or Mul while running under burn-autodiff (training mode).","commonSituations":"Using exotic scatter update semantics (e.g. custom assignment/max updates) during gradient computation; forward-only code on the base backend may work but the autodiff wrapper panics.","solutions":["Restrict scatter updates to Add, Sub, or Mul inside training (autodiff) code.","Perform unsupported scatter updates outside the autodiff graph (e.g. under no_grad / on non-grad tensors).","Add a gradient rule for the missing IndexingUpdateOp in burn-autodiff and upstream it."],"exampleFix":"// before\ntensor.scatter(1, indices, value, IndexingUpdateOp::Assign);\n// after\ntensor.scatter(1, indices, value, IndexingUpdateOp::Add);","handlingStrategy":"validation","validationCode":"assert!(matches!(op, IndexingUpdateOp::Add | IndexingUpdateOp::Sub | IndexingUpdateOp::Mul), \"autodiff float_scatter only supports Add/Sub/Mul\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict scatter update ops to Add/Sub/Mul in training code.","Perform unsupported scatter updates outside gradient tracking.","Search burn-autodiff's indexing ops for the supported update list before adding new scatter uses."],"tags":["rust","burn","autodiff","scatter","unimplemented"],"backgroundTag":"op-not-implemented-for-backend","analyzedSha":"d16f7ba2ed0d41408189384044cc886fb4c8f957","analyzedAt":"2026-09-05T13:19:14.260Z","contentChangedAt":"2026-09-05T13:19:14.260Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}