{"record":{"id":"968d9abd80e600f2","repo":"tracel-ai/burn","slug":"not-yet-implemented-for-iteration","errorCode":null,"errorMessage":"Not yet implemented for iteration","messagePattern":"Not yet implemented for iteration","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-std/src/data/tensor/conversion.rs","lineNumber":209,"sourceCode":"                            shape: self.shape.clone(),\n                        };\n                        let (values, _) = q_bytes.into_vec_i8();\n\n                        Box::new(\n                            values\n                                .iter()\n                                .map(|e: &i8| e.elem::<E>())\n                                .collect::<Vec<_>>()\n                                .into_iter(),\n                        )\n                    }\n                    QuantScheme {\n                        mode: QuantMode::Symmetric,\n                        value:\n                            QuantValue::E4M3 | QuantValue::E5M2 | QuantValue::E2M1,\n                        ..\n                    } => {\n                        unimplemented!(\"Not yet implemented for iteration\");\n                    }\n                    QuantScheme {\n                        mode: QuantMode::Lookup,\n                        ..\n                    } => {\n                        unimplemented!(\"lookup quantization is not supported for iteration\");\n                    }\n                },\n            }\n        }\n    }\n\n    /// Converts the data to the dtype represented by `E`.\n    ///\n    /// # Panics\n    ///\n    /// Panics if storage access fails, the conversion isn't supported, or the stored\n    /// representation or element count is invalid.","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-std/src/data/tensor/conversion.rs#L191-L227","documentation":"TensorData::iter::<E>() (crates/burn-std/src/data/tensor/conversion.rs:203-210) supports iterating quantized data only for symmetric schemes with Q8/Q4/Q2 values. For symmetric float-point quantization (E4M3, E5M2, E2M1) iteration/element-casting is explicitly not implemented, so an `unimplemented!` panic is raised instead of returning an iterator.","triggerScenarios":"Calling `tensor_data.iter::<E>()` (or code paths like into_vec_i8-driven iteration / morph_impl that rely on it) on a QFloat TensorData whose scheme is Symmetric with QuantValue::E4M3, E5M2, or E2M1.","commonSituations":"Converting an FP8/FP4-quantized tensor to plain floats by iterating elements, e.g. `data.iter::<f32>()`, after quantizing with an E4M3 scheme, or running a tensor morph/conversion pipeline over float-point-quantized data.","solutions":["Dequantize the tensor to a float dtype first (use the dequantize API) and iterate the resulting float tensor.","Use Q8S/Q8F (int8) quantization schemes if element-wise iteration is required.","Upgrade burn once float-point quantized iteration support lands; check the changelog.","Manually decode E4M3/E5M2/E2M1 bits from the raw bytes yourself."],"exampleFix":"// before\nfor v in q_tensor_data.iter::<f32>() { /* panics */ }\n// after\nlet f_data = q_tensor.dequantize(); // returns float TensorData\nfor v in f_data.iter::<f32>() { /* ok */ }","handlingStrategy":"type-guard","validationCode":"fn is_iterable_quantized(dtype: &DType) -> bool {\n    match dtype {\n        DType::QFloat(s) => matches!(\n            s,\n            QuantScheme { mode: QuantMode::Symmetric, value: QuantValue::Q8F | QuantValue::Q8S | QuantValue::Q4F | QuantValue::Q4S | QuantValue::Q2F | QuantValue::Q2S, .. }\n        ),\n        _ => true,\n    }\n}","typeGuard":"fn iterable_q_scheme(scheme: &QuantScheme) -> bool {\n    matches!(scheme.mode, QuantMode::Symmetric)\n        && !matches!(scheme.value, QuantValue::E4M3 | QuantValue::E5M2 | QuantValue::E2M1)\n}","tryCatchPattern":"// iter panics instead of returning Err; check the scheme first, else dequantize\nif iterable_q_scheme(&scheme) {\n    let vals: Vec<f32> = data.iter::<f32>().collect();\n} else {\n    let vals: Vec<f32> = dequantize_to_float(data).iter::<f32>().collect();\n}","preventionTips":["Only call iter::<E>() on symmetric Q8/Q4/Q2 quantized data.","Dequantize E4M3/E5M2/E2M1 tensors before element-wise access.","Document in your pipeline which quantization schemes support raw iteration."],"tags":["rust","burn","quantization","iteration","unimplemented"],"backgroundTag":"unimplemented-feature-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"}