{"record":{"id":"0816489308b74bd2","repo":"tracel-ai/burn","slug":"float-select-assign-with-other-update-is-not-i-081648","errorCode":null,"errorMessage":"float_select_assign with {other:?} update is not implemented","messagePattern":"float_select_assign with (.+?) update is not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-flex/src/ops/float.rs","lineNumber":452,"sourceCode":"                DType::F32 => {\n                    crate::ops::gather_scatter::select_mul::<f32>(tensor, dim, indices, value)\n                }\n                DType::F64 => {\n                    crate::ops::gather_scatter::select_mul::<f64>(tensor, dim, indices, value)\n                }\n                DType::F16 => {\n                    crate::ops::gather_scatter::select_mul::<f16>(tensor, dim, indices, value)\n                }\n                DType::BF16 => {\n                    crate::ops::gather_scatter::select_mul::<bf16>(tensor, dim, indices, value)\n                }\n                _ => panic!(\n                    \"float_select_assign: unsupported dtype {:?}\",\n                    tensor.dtype()\n                ),\n            },\n            other => {\n                unimplemented!(\"float_select_assign with {other:?} update is not implemented\")\n            }\n        }\n    }\n\n    fn float_slice(tensor: FloatTensor<Flex>, slices: &[Slice]) -> FloatTensor<Flex> {\n        crate::ops::slice::slice(tensor, slices)\n    }\n\n    fn float_slice_assign(\n        tensor: FloatTensor<Flex>,\n        slices: &[Slice],\n        value: FloatTensor<Flex>,\n    ) -> FloatTensor<Flex> {\n        crate::ops::slice::slice_assign(tensor, slices, value)\n    }\n\n    fn float_mask_where(\n        tensor: FloatTensor<Flex>,","sourceCodeStart":434,"sourceCodeEnd":470,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-flex/src/ops/float.rs#L434-L470","documentation":"burn-flex's `float_select_assign` only supports update (`value`) tensors with float dtypes; any other dtype category hits the `other` arm and panics with `unimplemented!(\"float_select_assign with {other:?} update is not implemented\")`.","triggerScenarios":"Calling `Tensor::select_assign` / `float_select_assign` on a float tensor while supplying an int, uint, or bool `values` tensor.","commonSituations":"Assigning integer labels or boolean masks into float tensors during data preprocessing; mixing tensors produced by int ops (argmax, comparisons) directly as select values.","solutions":["Cast the value tensor to the float dtype of the target tensor before assigning: `values.cast(DType::F32)`","Verify the value tensor is produced by float ops","Add a dtype assertion at the call site","Avoid mixing int/bool results as assign targets"],"exampleFix":"// before\nlet out = tensor.select_assign(dim, indices, mask_i32);\n// after\nlet out = tensor.select_assign(dim, indices, mask_i32.cast(DType::F32));","handlingStrategy":"type-guard","validationCode":"assert!(matches!(values.dtype(), DType::F32 | DType::F64 | DType::BF16 | DType::F16), \"float_select_assign requires a float update tensor\");","typeGuard":"fn is_float_dtype(d: DType) -> bool {\n    matches!(d, DType::F32 | DType::F64 | DType::BF16 | DType::F16)\n}","tryCatchPattern":"// Rust panics abort; validate before calling\nif !is_float_dtype(values.dtype()) {\n    values = values.cast(tensor.dtype());\n}\nlet out = tensor.select_assign(dim, indices, values);","preventionTips":["Cast masks/labels to float before select_assign on float tensors","Keep dtype conversions at pipeline boundaries, not at op call sites","Unit-test select_assign with all dtypes flowing through your code","Log dtypes of both operands when debugging select errors"],"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"}