{"record":{"id":"4626b17c55265041","repo":"tracel-ai/burn","slug":"int-select-assign-with-other-update-is-not-imp-4626b1","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-tch/src/ops/int_tensor.rs","lineNumber":342,"sourceCode":"    fn int_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!(\"int_select_assign with {other:?} update is not implemented\")\n            }\n        }\n    }\n\n    fn int_mask_where(tensor: TchTensor, mask: TchTensor, source: TchTensor) -> TchTensor {\n        TchTensor::binary_ops_tensor(\n            tensor,\n            source,\n            |tensor, source| source.f_where_self(&mask.tensor, tensor).unwrap(),\n            |tensor, source| source.f_where_self(&mask.tensor, tensor).unwrap(),\n            |tensor, source| source.f_where_self(&mask.tensor, tensor).unwrap(),\n        )\n    }\n\n    fn int_mask_fill(tensor: TchTensor, mask: TchTensor, value: Scalar) -> TchTensor {\n        let value = value.elem::<i64>();\n        tensor.unary_ops(\n            |mut tensor| tensor.f_masked_fill_(&mask.tensor, value).unwrap(),","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-tch/src/ops/int_tensor.rs#L324-L360","documentation":"int_select_assign in burn-tch supports only IndexingUpdateOp::Add and IndexingUpdateOp::Mul (via TchOps::select_assign and select_assign_mul). Any other update op variant reaches the unimplemented!() branch and panics with the op name in the message.","triggerScenarios":"Assigning values at selected indices of an integer tensor on LibTorch with an IndexingUpdateOp other than Add/Mul (e.g. Sub, Max) via select_assign-style indexing APIs.","commonSituations":"Porting code that used Sub/Min select-assign from another backend; new IndexingUpdateOp variants added to burn-core that burn-tch hasn't implemented; custom training/inference code doing indexed accumulation with nonstandard updates.","solutions":["Rewrite the update using Add/Mul semantics (e.g. Sub by adding the negated value)","Implement the assignment with mask_where or manual tensor ops supported by the backend","Update burn/burn-tch to a release implementing the needed op for tch","Contribute the missing match arm mapping the op to torch's index_put/scatter variants"],"exampleFix":"// before\ntensor.select_assign(dim, indices, value, IndexingUpdateOp::Sub);\n\n// after\ntensor.select_assign(dim, indices, -value, IndexingUpdateOp::Add);","handlingStrategy":"validation","validationCode":"match op {\n    IndexingUpdateOp::Add | IndexingUpdateOp::Mul => { /* safe */ }\n    other => panic!(\"unsupported select_assign op {:?}\", other),\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only Add/Mul for select_assign on LibTorch","Precompute negated values so Sub can be expressed as Add","Pin down IndexingUpdateOp usage in an abstraction that validates per backend"],"tags":["rust","burn","libtorch","tensor","indexing"],"backgroundTag":"unsupported-scatter-update-op","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"}