{"record":{"id":"0850202d8c14d67a","repo":"tracel-ai/burn","slug":"float-select-assign-with-other-update-is-not-i-085020","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-tch/src/ops/tensor.rs","lineNumber":253,"sourceCode":"    fn float_select_assign(\n        tensor: TchTensor,\n        dim: usize,\n        indices: TchTensor,\n        value: TchTensor,\n        update: burn_backend::tensor::IndexingUpdateOp,\n    ) -> TchTensor {\n        match update {\n            burn_backend::tensor::IndexingUpdateOp::Assign => {\n                TchOps::select_assign_replace(tensor, dim, indices, value)\n            }\n            burn_backend::tensor::IndexingUpdateOp::Add => {\n                TchOps::select_assign(tensor, dim, indices, value)\n            }\n            burn_backend::tensor::IndexingUpdateOp::Mul => {\n                TchOps::select_assign_mul(tensor, dim, indices, value)\n            }\n            other => {\n                unimplemented!(\"float_select_assign with {other:?} update is not implemented\")\n            }\n        }\n    }\n\n    fn float_slice(tensor: TchTensor, slices: &[burn_backend::Slice]) -> TchTensor {\n        TchOps::slice_with_steps(tensor, slices)\n    }\n\n    fn float_slice_assign(\n        tensor: TchTensor,\n        slices: &[burn_backend::Slice],\n        value: TchTensor,\n    ) -> TchTensor {\n        TchOps::slice_assign(tensor, slices, value)\n    }\n\n    fn float_mask_where(tensor: TchTensor, mask: TchTensor, value: TchTensor) -> TchTensor {\n        let output = value.tensor.where_self(&mask.tensor, &tensor.tensor);","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-tch/src/ops/tensor.rs#L235-L271","documentation":"`float_select_assign` maps an IndexingUpdateOp onto select_assign kernels; only Set/Add/Mul (via TchOps::select_assign and select_assign_mul) are implemented. Any other update op panics with this unimplemented!() message.","triggerScenarios":"Calling `tensor.select_assign(dim, indices, value, op)` — or select/scatter-style assignment APIs lowering to it — with an IndexingUpdateOp other than Set/Add/Mul on a tch float tensor.","commonSituations":"Index-assignment code written against burn-core's expanding IndexingUpdateOp enum executed on the libtorch backend; upgrading burn-core without matching burn-tch, so new variants reach the catch-all arm.","solutions":["Rewrite the update using a supported op: select_assign with Add of negated values for subtraction, etc.","Keep burn-core and burn-tch versions in sync and upgrade if the variant is now supported","Perform elementwise math after a plain Set-based select_assign","Guard the call site by matching only on supported ops"],"exampleFix":"// before\ntensor.select_assign(0, &idx, value, IndexingUpdateOp::Div);\n// panics\n// after\nlet inv = value.recip();\ntensor.select_assign(0, &idx, inv, IndexingUpdateOp::Mul);","handlingStrategy":"validation","validationCode":"assert!(is_supported_update(&op));","typeGuard":"fn is_supported_update(op: &IndexingUpdateOp) -> bool {\n    matches!(op, IndexingUpdateOp::Set | IndexingUpdateOp::Add | IndexingUpdateOp::Mul)\n}","tryCatchPattern":null,"preventionTips":["Use only Set/Add/Mul for select_assign on libtorch","Convert Division/Subtraction updates at a higher level","Keep burn crate versions aligned"],"tags":["rust","libtorch","select-assign","unimplemented"],"backgroundTag":"unimplemented-op-panic","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"}