{"record":{"id":"f7be2577d8f09dd6","repo":"tracel-ai/burn","slug":"int-select-assign-with-other-update-is-not-imp-f7be25","errorCode":null,"errorMessage":"int_select_assign with {other:?} update is not implemented","messagePattern":"int_select_assign with (.+?) update is not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-flex/src/ops/int.rs","lineNumber":413,"sourceCode":"                        crate::ops::gather_scatter::select_mul::<i8>(tensor, dim, indices, value)\n                    }\n                    DType::U64 => {\n                        crate::ops::gather_scatter::select_mul::<u64>(tensor, dim, indices, value)\n                    }\n                    DType::U32 => {\n                        crate::ops::gather_scatter::select_mul::<u32>(tensor, dim, indices, value)\n                    }\n                    DType::U16 => {\n                        crate::ops::gather_scatter::select_mul::<u16>(tensor, dim, indices, value)\n                    }\n                    DType::U8 => {\n                        crate::ops::gather_scatter::select_mul::<u8>(tensor, dim, indices, value)\n                    }\n                    dt => panic!(\"int_select_assign: unsupported dtype {:?}\", dt),\n                }\n            }\n            other => {\n                unimplemented!(\"int_select_assign with {other:?} update is not implemented\")\n            }\n        }\n    }\n\n    fn int_equal(\n        lhs: IntTensor<Flex>,\n        rhs: IntTensor<Flex>,\n        out_dtype: burn_std::BoolDType,\n    ) -> BoolTensor<Flex> {\n        crate::ops::comparison::int_equal(lhs, rhs, out_dtype)\n    }\n\n    fn int_equal_elem(\n        lhs: IntTensor<Flex>,\n        rhs: Scalar,\n        out_dtype: burn_std::BoolDType,\n    ) -> BoolTensor<Flex> {\n        let (i, u) = scalar_to_int_pair(lhs.dtype(), &rhs);","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-flex/src/ops/int.rs#L395-L431","documentation":"burn-flex's `int_select_assign` only accepts integer-family update dtypes; a float (or other non-int) `values` tensor falls into the `other` arm and panics with `unimplemented!(\"int_select_assign with {other:?} update is not implemented\")`.","triggerScenarios":"Calling `int_select_assign` / select_assign on an int tensor while passing a float `values` tensor.","commonSituations":"Assigning float scores/weights into index tensors; tensors defaulting to F32 elsewhere in the pipeline then reused for int assignments.","solutions":["Cast the value tensor to the int dtype before assigning: `values.cast(DType::I64)` / `.int()`","Use a float data tensor if float assignments are intended","Assert value.dtype.is_int() before the call","Trace where the float value tensor originates and fix it upstream"],"exampleFix":"// before\nlet out = labels.select_assign(dim, indices, scores_f32);\n// after\nlet out = labels.select_assign(dim, indices, scores_f32.cast(DType::I64));","handlingStrategy":"type-guard","validationCode":"assert!(values.dtype().is_int() || values.dtype().is_uint(), \"int_select_assign requires an int/uint update tensor\");","typeGuard":"fn is_int_dtype(d: DType) -> bool {\n    d.is_int() || d.is_uint()\n}","tryCatchPattern":"// guard before the call; the panic is not recoverable\nif !is_int_dtype(values.dtype()) {\n    values = values.cast(labels.dtype());\n}\nlet out = labels.select_assign(dim, indices, values);","preventionTips":["Cast scores/float tensors to the label dtype before select_assign","Trace the origin of float value tensors and convert upstream","Add dtype checks in assignment helper utilities","Keep label/index tensors consistently int across the pipeline"],"tags":["rust","dtype","select-assign","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"}