{"record":{"id":"48835a6f0a048e5f","repo":"tracel-ai/burn","slug":"int-scatter-with-other-update-is-not-implement","errorCode":null,"errorMessage":"int_scatter with {other:?} update is not implemented","messagePattern":"int_scatter with (.+?) update is not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-cubecl/src/ops/int_tensor.rs","lineNumber":140,"sourceCode":"\n    fn int_scatter(\n        dim: usize,\n        tensor: IntTensor<Self>,\n        indices: IntTensor<Self>,\n        value: IntTensor<Self>,\n        update: burn_backend::tensor::IndexingUpdateOp,\n    ) -> IntTensor<Self> {\n        match update {\n            burn_backend::tensor::IndexingUpdateOp::Assign => {\n                kernel::scatter_assign(dim, tensor, indices, value)\n            }\n            burn_backend::tensor::IndexingUpdateOp::Add => {\n                kernel::scatter(dim, tensor, indices, value, false)\n            }\n            burn_backend::tensor::IndexingUpdateOp::Mul => {\n                kernel::scatter_mul(dim, tensor, indices, value)\n            }\n            other => unimplemented!(\"int_scatter with {other:?} update is not implemented\"),\n        }\n    }\n\n    fn int_scatter_nd(\n        data: IntTensor<Self>,\n        indices: IntTensor<Self>,\n        values: IntTensor<Self>,\n        reduction: burn_backend::tensor::IndexingUpdateOp,\n    ) -> IntTensor<Self> {\n        kernel::scatter_nd(data, indices, values, reduction)\n    }\n\n    fn int_gather_nd(data: IntTensor<Self>, indices: IntTensor<Self>) -> IntTensor<Self> {\n        kernel::gather_nd(data, indices)\n    }\n\n    fn int_select(\n        tensor: IntTensor<Self>,","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-cubecl/src/ops/int_tensor.rs#L122-L158","documentation":"burn-cubecl's int_scatter only implements IndexingUpdateOp::Add (kernel::scatter) and IndexingUpdateOp::Mul (kernel::scatter_mul) for updating scattered values on integer tensors. Any other IndexingUpdateOp variant (e.g. Sub) reaches the catch-all `other` arm and panics via unimplemented!. The operation is simply not yet implemented for this CubeCl int-tensor backend.","triggerScenarios":"Calling int_scatter (or a higher-level API like Tensor::scatter with an indexing update op) on an integer tensor with a CubeCl backend using any IndexingUpdateOp other than Add or Mul, e.g. IndexingUpdateOp::Sub.","commonSituations":"Porting float tensor scatter code that uses subtraction-based updates to int tensors; switching backends and discovering feature parity gaps; upgrading burn to a version where new IndexingUpdateOp variants were added but the CubeCl int path was not extended.","solutions":["Rewrite the scatter update in terms of a supported op: perform scatter with Add/Mul, or emulate Sub by scattering the negated value with Add.","Fall back to a scatter-then-arith pattern: clone the tensor, use slice_assign on computed index positions, or gather + build + scatter.","Implement the missing arm in crates/burn-cubecl/src/ops/int_tensor.rs by adding an int kernel (e.g. kernel::scatter_sub) and contributing it upstream.","Track the burn issue tracker for IndexingUpdateOp::Sub support on CubeCl backends."],"exampleFix":"// before\nlet out = tensor.scatter(dim, indices, updates, IndexingUpdateOp::Sub);\n// after (emulate Sub via Add of negated values)\nlet neg = -updates;\nlet out = tensor.scatter(dim, indices, neg, IndexingUpdateOp::Add);","handlingStrategy":"validation","validationCode":"fn supports_scatter_op(op: &IndexingUpdateOp) -> bool {\n    matches!(op, IndexingUpdateOp::Add | IndexingUpdateOp::Mul)\n}\nassert!(supports_scatter_op(&my_op), \"int_scatter only supports Add/Mul on CubeCl\");","typeGuard":"fn is_supported_update_op(op: &IndexingUpdateOp) -> bool {\n    matches!(op, IndexingUpdateOp::Add | IndexingUpdateOp::Mul)\n}","tryCatchPattern":null,"preventionTips":["Only use IndexingUpdateOp::Add or Mul with scatter on CubeCl backends","Emulate Sub by scattering negated values with Add","Check backend docs for indexing-update-op support before sharing code across backends","Add unit tests that cover each IndexingUpdateOp variant you use per backend"],"tags":["rust","burn","cubecl","scatter","unimplemented"],"backgroundTag":"unsupported-op-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"}