{"record":{"id":"e5490af705d25389","repo":"tracel-ai/burn","slug":"int-select-assign-unsupported-dtype","errorCode":null,"errorMessage":"int_select_assign: unsupported dtype {:?}","messagePattern":"int_select_assign: unsupported dtype (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-flex/src/ops/int.rs","lineNumber":341,"sourceCode":"                    DType::I16 => crate::ops::gather_scatter::select_assign::<i16>(\n                        tensor, dim, indices, value,\n                    ),\n                    DType::I8 => {\n                        crate::ops::gather_scatter::select_assign::<i8>(tensor, dim, indices, value)\n                    }\n                    DType::U64 => crate::ops::gather_scatter::select_assign::<u64>(\n                        tensor, dim, indices, value,\n                    ),\n                    DType::U32 => crate::ops::gather_scatter::select_assign::<u32>(\n                        tensor, dim, indices, value,\n                    ),\n                    DType::U16 => crate::ops::gather_scatter::select_assign::<u16>(\n                        tensor, dim, indices, value,\n                    ),\n                    DType::U8 => {\n                        crate::ops::gather_scatter::select_assign::<u8>(tensor, dim, indices, value)\n                    }\n                    dt => panic!(\"int_select_assign: unsupported dtype {:?}\", dt),\n                }\n            }\n            burn_backend::tensor::IndexingUpdateOp::Add => {\n                debug_assert_eq!(\n                    tensor.dtype(),\n                    value.dtype(),\n                    \"int_select_assign: dtype mismatch\"\n                );\n                match tensor.dtype() {\n                    DType::I64 => {\n                        crate::ops::gather_scatter::select_add::<i64>(tensor, dim, indices, value)\n                    }\n                    DType::I32 => {\n                        crate::ops::gather_scatter::select_add::<i32>(tensor, dim, indices, value)\n                    }\n                    DType::I16 => {\n                        crate::ops::gather_scatter::select_add::<i16>(tensor, dim, indices, value)\n                    }","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-flex/src/ops/int.rs#L323-L359","documentation":"int_select_assign panics on the set-assignment path when the tensor dtype is not one of the eight implemented integer widths. select_assign writes fixed-width values at index positions, so unknown dtypes cannot be written safely and the library panics instead.","triggerScenarios":"Calling int_select_assign with IndexingUpdateOp::Set on a tensor whose dtype is not i64/i32/i16/i8/u64/u32/u16/u8, or when tensor and value dtypes differ so the wrong arm is evaluated.","commonSituations":"Assigning into selected ranges of bool-masked tensors, dtype drift between target and value, or a burn upgrade introducing a DType variant burn-flex does not cover.","solutions":["Cast tensor and value to a supported int dtype before the select_assign call","Guarantee tensor.dtype() == value.dtype() as a precondition","Confirm Set is the intended update op; this panic is the Set arm","Add a select_assign match arm calling crate::ops::gather_scatter::select_assign::<T> for new dtypes"],"exampleFix":"// before\ntensor.select_assign(dim, indices, value, IndexingUpdateOp::Set); // tensor is DType::Bool\n// after\nlet tensor = tensor.cast(DType::I32);\nlet value = value.cast(DType::I32);\ntensor.select_assign(dim, indices, value, IndexingUpdateOp::Set);","handlingStrategy":"validation","validationCode":"assert_eq!(tensor.dtype(), value.dtype(), \"select_assign: dtype mismatch\");\nassert!(is_supported_int_dtype(tensor.dtype()), \"unsupported dtype {:?}\", tensor.dtype());","typeGuard":"fn is_supported_int_dtype(dt: burn::tensor::DType) -> bool {\n    matches!(\n        dt,\n        burn::tensor::DType::I64 | burn::tensor::DType::I32\n            | burn::tensor::DType::I16 | burn::tensor::DType::I8\n            | burn::tensor::DType::U64 | burn::tensor::DType::U32\n            | burn::tensor::DType::U16 | burn::tensor::DType::U8\n    )\n}","tryCatchPattern":null,"preventionTips":["Normalize tensor and value to the same int dtype before select_assign","Use Set updates only on integer tensors","Enable debug_asserts in CI to catch dtype mismatches early","Keep dtype casts explicit at API boundaries"],"tags":["rust","dtype","panic","select-assign","burn-flex"],"backgroundTag":"unsupported-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"}