{"record":{"id":"5e64186a57829eda","repo":"tracel-ai/burn","slug":"float-scatter-with-other-update-is-not-impleme-5e6418","errorCode":null,"errorMessage":"float_scatter with {other:?} update is not implemented","messagePattern":"float_scatter with (.+?) update is not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-tch/src/ops/tensor.rs","lineNumber":214,"sourceCode":"\n    fn float_scatter(\n        dim: usize,\n        tensor: TchTensor,\n        indices: TchTensor,\n        value: TchTensor,\n        update: burn_backend::tensor::IndexingUpdateOp,\n    ) -> TchTensor {\n        match update {\n            burn_backend::tensor::IndexingUpdateOp::Assign => {\n                TchOps::scatter_assign(dim, tensor, indices, value)\n            }\n            burn_backend::tensor::IndexingUpdateOp::Add => {\n                TchOps::scatter(dim, tensor, indices, value)\n            }\n            burn_backend::tensor::IndexingUpdateOp::Mul => {\n                TchOps::scatter_mul(dim, tensor, indices, value)\n            }\n            other => unimplemented!(\"float_scatter with {other:?} update is not implemented\"),\n        }\n    }\n\n    fn float_scatter_nd(\n        data: TchTensor,\n        indices: TchTensor,\n        values: TchTensor,\n        reduction: burn_backend::tensor::IndexingUpdateOp,\n    ) -> TchTensor {\n        TchOps::scatter_nd(data, indices, values, reduction)\n    }\n\n    fn float_gather_nd(data: TchTensor, indices: TchTensor) -> TchTensor {\n        TchOps::gather_nd(data, indices)\n    }\n\n    fn float_select(tensor: TchTensor, dim: usize, indices: TchTensor) -> TchTensor {\n        TchOps::index_select_dim(tensor, dim, indices)","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-tch/src/ops/tensor.rs#L196-L232","documentation":"`float_scatter` in burn-tch dispatches on the IndexingUpdateOp (Set/Add/Mul); any other update op hits the `other` arm and panics via `unimplemented!()`. The backend only supports scatter with set, add, and multiply updates for float tensors.","triggerScenarios":"Calling `tensor.scatter(dim, indices, value, op)` — or an API lowering to it — with an IndexingUpdateOp other than Set, Add, or Mul (e.g. Sub, Div, Min, Max) on a tch float tensor.","commonSituations":"Using newly added IndexingUpdateOp variants with the libtorch backend before support lands; generic code parameterized over update ops run against tch; version skew where burn-core gained an op variant burn-tch hasn't implemented.","solutions":["Express the update using a supported op (Set/Add/Mul), e.g. scatter with Add of the negated values for Sub","Restructure so the update happens as element-wise math after a supported scatter","Upgrade burn-tch in case the variant is now supported","Add an explicit match/guard on supported ops before calling scatter"],"exampleFix":"// before\ntensor.scatter(0, &indices, value, IndexingUpdateOp::Sub);\n// panics\n// after\ntensor.scatter(0, &indices, -value, IndexingUpdateOp::Add);","handlingStrategy":"validation","validationCode":"assert!(is_supported_update(&op));","typeGuard":"fn is_supported_update(op: &IndexingUpdateOp) -> bool {\n    matches!(op, IndexingUpdateOp::Set | IndexingUpdateOp::Add | IndexingUpdateOp::Mul)\n}","tryCatchPattern":null,"preventionTips":["Avoid newer IndexingUpdateOp variants on tch until supported","Rewrite Sub/Div scatters as Add/Mul equivalents","Verify backend support before genericizing over update ops"],"tags":["rust","libtorch","scatter","unimplemented"],"backgroundTag":"unimplemented-op-panic","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"}