{"record":{"id":"1ff3b5e091aeea6f","repo":"tracel-ai/burn","slug":"int-scatter-with-other-update-is-not-implement-1ff3b5","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-flex/src/ops/int.rs","lineNumber":227,"sourceCode":"                    DType::I8 => {\n                        crate::ops::gather_scatter::scatter_mul::<i8>(tensor, dim, indices, value)\n                    }\n                    DType::U64 => {\n                        crate::ops::gather_scatter::scatter_mul::<u64>(tensor, dim, indices, value)\n                    }\n                    DType::U32 => {\n                        crate::ops::gather_scatter::scatter_mul::<u32>(tensor, dim, indices, value)\n                    }\n                    DType::U16 => {\n                        crate::ops::gather_scatter::scatter_mul::<u16>(tensor, dim, indices, value)\n                    }\n                    DType::U8 => {\n                        crate::ops::gather_scatter::scatter_mul::<u8>(tensor, dim, indices, value)\n                    }\n                    dt => panic!(\"int_scatter: unsupported dtype {:?}\", dt),\n                }\n            }\n            other => unimplemented!(\"int_scatter with {other:?} update is not implemented\"),\n        }\n    }\n\n    fn int_scatter_nd(\n        data: IntTensor<Flex>,\n        indices: IntTensor<Flex>,\n        values: IntTensor<Flex>,\n        reduction: burn_backend::tensor::IndexingUpdateOp,\n    ) -> IntTensor<Flex> {\n        match data.dtype() {\n            DType::I64 => {\n                crate::ops::gather_scatter::scatter_nd::<i64>(data, indices, values, reduction)\n            }\n            DType::I32 => {\n                crate::ops::gather_scatter::scatter_nd::<i32>(data, indices, values, reduction)\n            }\n            DType::I16 => {\n                crate::ops::gather_scatter::scatter_nd::<i16>(data, indices, values, reduction)","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-flex/src/ops/int.rs#L209-L245","documentation":"burn-flex's `int_scatter` supports integer/uint dtypes (I32/I64/U8/...) for the update tensor, but a non-int update dtype (e.g. float) reaches the `other` arm and panics with `unimplemented!(\"int_scatter with {other:?} update is not implemented\")`.","triggerScenarios":"Calling `int_scatter` / scatter on an integer tensor with a float `values` update tensor.","commonSituations":"Scattering float values (e.g. averages, weights) into an int histogram/count tensor; dtype drift after changing tensor construction to `.float()` defaults.","solutions":["Cast the update tensor to the int dtype of the data tensor: `values.cast(DType::I32)` or `.int()`","If float values are truly needed, use a float tensor for the data as well","Inspect `values.dtype` before scattering and branch accordingly","Round/convert float payloads to ints explicitly if counts are intended"],"exampleFix":"// before\nlet updated = counts.scatter(dim, indices, sums_f32);\n// after\nlet updated = counts.scatter(dim, indices, sums_f32.cast(DType::I32));","handlingStrategy":"type-guard","validationCode":"assert!(values.dtype().is_int() || values.dtype().is_uint(), \"int_scatter requires an int/uint update tensor\");","typeGuard":"fn is_int_dtype(d: DType) -> bool {\n    d.is_int() || d.is_uint()\n}","tryCatchPattern":"// validate before calling; panic cannot be caught\nif !is_int_dtype(values.dtype()) {\n    values = values.cast(DType::I64);\n}\nlet out = counts.scatter(dim, indices, values);","preventionTips":["Cast float payloads to int before scattering into int tensors","Avoid `.float()` defaults leaking into int scatter paths","Assert data and value dtypes agree in scatter helpers","Review dtype flow when refactoring tensor constructors"],"tags":["rust","dtype","scatter","burn-flex"],"backgroundTag":"unsupported-scatter-dtype","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"}