{"record":{"id":"4942cb6165137ce4","repo":"tracel-ai/burn","slug":"lookup-quantization-is-not-supported-by-the-ndarra","errorCode":null,"errorMessage":"lookup quantization is not supported by the ndarray backend","messagePattern":"lookup quantization is not supported by the ndarray backend","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-ndarray/src/tensor.rs","lineNumber":736,"sourceCode":"    pub fn strategy(&self) -> QuantizationStrategy {\n        match (self.scheme.mode, self.scheme.block_size()) {\n            (QuantMode::Symmetric, None) => QuantizationStrategy::PerTensorSymmetric(\n                SymmetricQuantization::init(self.qparams[0], self.scheme.value),\n            ),\n            (QuantMode::Symmetric, Some(block_size)) => QuantizationStrategy::PerBlockSymmetric(\n                self.qparams\n                    .iter()\n                    .map(|&s| {\n                        SymmetricQuantization::init(\n                            self.global.unwrap_or(1.0) * s,\n                            self.scheme.value,\n                        )\n                    })\n                    .collect(),\n                block_size,\n            ),\n            (QuantMode::Lookup, _) => {\n                unimplemented!(\"lookup quantization is not supported by the ndarray backend\")\n            }\n        }\n    }\n}\n\nimpl TensorMetadata for NdArrayQTensor {\n    type Device = NdArrayDevice;\n    fn dtype(&self) -> DType {\n        DType::QFloat(self.scheme)\n    }\n\n    fn shape(&self) -> Shape {\n        self.qtensor.shape()\n    }\n\n    fn rank(&self) -> usize {\n        self.shape().num_dims()\n    }","sourceCodeStart":718,"sourceCodeEnd":754,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-ndarray/src/tensor.rs#L718-L754","documentation":"Capability guard in the ndarray quantized tensor's `strategy()`: lookup-based (codebook/LUT) quantization has no ndarray implementation, so requesting the quantization strategy of such a tensor panics.","triggerScenarios":"Thrown at crates/burn-ndarray/src/tensor.rs:736 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a symmetric (non-lookup) quantization scheme with the ndarray backend","Dequantize on a backend that supports lookup quantization before moving to ndarray","Implement lookup support in burn-ndarray if required"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}