{"record":{"id":"92f48de167166226","repo":"tracel-ai/burn","slug":"float-select-assign-with-other-update-is-not-i-92f48d","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-cubecl/src/ops/tensor.rs","lineNumber":237,"sourceCode":"    fn float_select_assign(\n        tensor: FloatTensor<Self>,\n        dim: usize,\n        indices: IntTensor<Self>,\n        value: FloatTensor<Self>,\n        update: burn_backend::tensor::IndexingUpdateOp,\n    ) -> FloatTensor<Self> {\n        match update {\n            burn_backend::tensor::IndexingUpdateOp::Assign => {\n                kernel::select_assign_replace(tensor, dim, indices, value)\n            }\n            burn_backend::tensor::IndexingUpdateOp::Add => {\n                kernel::select_assign(tensor, dim, indices, value, false)\n            }\n            burn_backend::tensor::IndexingUpdateOp::Mul => {\n                kernel::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: FloatTensor<Self>, slices: &[Slice]) -> FloatTensor<Self> {\n        // Check if all steps are 1\n        let all_steps_one = slices.iter().all(|info| info.step == 1);\n\n        if all_steps_one {\n            // Use optimized slice for step=1\n            let simple_ranges: Vec<Range<usize>> = slices\n                .iter()\n                .enumerate()\n                .map(|(i, slice)| slice.to_range(tensor.meta.shape()[i]))\n                .collect();\n\n            kernel::slice(tensor, &simple_ranges)\n        } else {","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-cubecl/src/ops/tensor.rs#L219-L255","documentation":"float_select_assign on the CubeCl backend supports only IndexingUpdateOp::Add and IndexingUpdateOp::Mul; any other variant reaches the catch-all and panics with unimplemented!. It mirrors the int_select_assign limitation at crates/burn-cubecl/src/ops/tensor.rs:237.","triggerScenarios":"Calling float_select_assign (or Tensor::select_assign) with the CubeCl backend and an IndexingUpdateOp other than Add/Mul (e.g. Sub).","commonSituations":"Masked/conditional updates with subtraction semantics; shared code across backends where another backend supports the op; upgrades introducing new IndexingUpdateOp variants.","solutions":["Use Add or Mul; for Sub, assign the negated values with Add.","Restructure as gather -> compute -> scatter/slice_assign for arbitrary updates.","Patch the backend: add a float select_assign kernel for the missing variant in crates/burn-cubecl/src/ops/tensor.rs.","Wrap exotic update ops behind a helper that checks backend support first."],"exampleFix":"// before\nlet out = tensor.select_assign(dim, indices, updates, IndexingUpdateOp::Sub);\n// after\nlet out = tensor.select_assign(dim, indices, -updates, IndexingUpdateOp::Add);","handlingStrategy":"validation","validationCode":"if !matches!(op, IndexingUpdateOp::Add | IndexingUpdateOp::Mul) {\n    eprintln!(\"float_select_assign on CubeCl supports only Add/Mul; falling back\");\n}","typeGuard":"fn select_assign_supported(op: &IndexingUpdateOp) -> bool {\n    matches!(op, IndexingUpdateOp::Add | IndexingUpdateOp::Mul)\n}","tryCatchPattern":null,"preventionTips":["Limit select_assign to Add/Mul update ops on CubeCl","Express Sub as Add of negated updates","Route unsupported variants through gather/slice_assign fallbacks","Add cross-backend op-parity tests to CI"],"tags":["rust","burn","cubecl","select-assign","unimplemented"],"backgroundTag":"unsupported-op-backend","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"}