{"record":{"id":"d3eff36f3e4fc386","repo":"tracel-ai/burn","slug":"todo-local-transfer-of-quantized-tensors-is-not","errorCode":null,"errorMessage":"todo!(\"Local transfer of quantized tensors is not supported yet\")","messagePattern":"todo!\\(\"Local transfer of quantized tensors is not supported yet\"\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-router/src/interpreter.rs","lineNumber":124,"sourceCode":"    /// primitive, and the destination calls `B::*_to_device` onto its own device. When both\n    /// interpreters share the same device, the backend's `to_device` is a cheap no-op.\n    pub fn register_tensor_to_device(&mut self, id: TensorId, tensor: HandleKind<B>) {\n        let ctx = &mut self.context;\n        match tensor {\n            HandleKind::Float(tensor) => {\n                let tensor = B::float_to_device(tensor, &self.device);\n                ctx.handles.register_float_tensor::<B>(&id, tensor);\n            }\n            HandleKind::Int(tensor) => {\n                let tensor = B::int_to_device(tensor, &self.device);\n                ctx.handles.register_int_tensor::<B>(&id, tensor);\n            }\n            HandleKind::Bool(tensor) => {\n                let tensor = B::bool_to_device(tensor, &self.device);\n                ctx.handles.register_bool_tensor::<B>(&id, tensor);\n            }\n            HandleKind::Quantized(_) => {\n                todo!(\"Local transfer of quantized tensors is not supported yet\");\n            }\n        }\n    }\n\n    /// Create a tensor with the given handle and shape.\n    pub fn register_tensor<C: RouterClient>(\n        &mut self,\n        handle: B::Handle,\n        shape: Shape,\n        dtype: DType,\n        client: C,\n    ) -> RouterTensor<C> {\n        let ctx = &mut self.context;\n        let id = ctx.create_empty_handle();\n\n        ctx.handles.register_handle(id, handle);\n\n        RouterTensor::new(id, shape, dtype, client)","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-router/src/interpreter.rs#L106-L142","documentation":"In burn-router's interpreter, `register_tensor_to_device` moves handles to `self.device` per HandleKind (Float/Int/Bool). The `HandleKind::Quantized` variant has no device-move implementation, so registering a quantized tensor to another device panics via `todo!` with 'Local transfer of quantized tensors is not supported yet'.","triggerScenarios":"Calling `.to_device()` (or any router operation that re-registers a tensor on a target device) on a quantized tensor whose handle kind is Quantized.","commonSituations":"Deploying quantized models across multiple devices with the router backend; running inference on a different GPU than where quantization happened; using a newer quantization API ahead of router support.","solutions":["Dequantize the tensor before moving devices, then re-quantize on the target device if needed.","Pin the quantized computation to a single device to avoid transfers.","Run on a single-device backend (no router) for quantized workloads.","Upgrade burn to a release that implements quantized device transfer."],"exampleFix":"// before\nquant_tensor.to_device(&device_b); // todo! panic\n// after\nlet f = quant_tensor.dequantize().to_device(&device_b);\nlet q = f.quantize(&q_params, scheme);","handlingStrategy":"validation","validationCode":"fn can_move_to_device(h: &HandleKind) -> bool {\n    !matches!(h, HandleKind::Quantized(_))\n}\nif !can_move_to_device(&handle) { /* dequantize first */ }","typeGuard":"fn is_quantized_handle(h: &HandleKind) -> bool { matches!(h, HandleKind::Quantized(_)) }","tryCatchPattern":null,"preventionTips":["Keep quantized tensors device-local; dequantize for transfers.","Run quantized inference on a single-device backend.","Verify HandleKind before router re-registration flows.","Upgrade burn when quantized device transfer lands upstream."],"tags":["burn","quantization","device-transfer","todo"],"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"}