{"record":{"id":"7403ac51750caf2b","repo":"tracel-ai/burn","slug":"conv-transpose1d-unsupported-dtype","errorCode":null,"errorMessage":"conv_transpose1d: unsupported dtype {:?}","messagePattern":"conv_transpose1d: unsupported dtype (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-flex/src/ops/module.rs","lineNumber":274,"sourceCode":"            DType::F64 => conv::conv3d_f64(x, weight, bias, &options),\n            DType::F16 => conv::conv3d_f16(x, weight, bias, &options),\n            DType::BF16 => conv::conv3d_bf16(x, weight, bias, &options),\n            dtype => panic!(\"conv3d: unsupported dtype {:?}\", dtype),\n        }\n    }\n\n    fn conv_transpose1d(\n        x: FloatTensor<Flex>,\n        weight: FloatTensor<Flex>,\n        bias: Option<FloatTensor<Flex>>,\n        options: ConvTransposeOptions<1>,\n    ) -> FloatTensor<Flex> {\n        match x.dtype() {\n            DType::F32 => conv_transpose::conv_transpose1d_f32(x, weight, bias, &options),\n            DType::F64 => conv_transpose::conv_transpose1d_f64(x, weight, bias, &options),\n            DType::F16 => conv_transpose::conv_transpose1d_f16(x, weight, bias, &options),\n            DType::BF16 => conv_transpose::conv_transpose1d_bf16(x, weight, bias, &options),\n            dtype => panic!(\"conv_transpose1d: unsupported dtype {:?}\", dtype),\n        }\n    }\n\n    fn conv_transpose2d(\n        x: FloatTensor<Flex>,\n        weight: FloatTensor<Flex>,\n        bias: Option<FloatTensor<Flex>>,\n        options: ConvTransposeOptions<2>,\n    ) -> FloatTensor<Flex> {\n        match x.dtype() {\n            DType::F32 => conv_transpose::conv_transpose2d_f32(x, weight, bias, &options),\n            DType::F64 => conv_transpose::conv_transpose2d_f64(x, weight, bias, &options),\n            DType::F16 => conv_transpose::conv_transpose2d_f16(x, weight, bias, &options),\n            DType::BF16 => conv_transpose::conv_transpose2d_bf16(x, weight, bias, &options),\n            dtype => panic!(\"conv_transpose2d: unsupported dtype {:?}\", dtype),\n        }\n    }\n","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-flex/src/ops/module.rs#L256-L292","documentation":"conv_transpose1d in the burn-flex backend selects between conv_transpose1d_f32/f64/f16/bf16 based on the input dtype; any other dtype panics. Transposed convolutions share the float-only restriction of regular convolutions, so integer or bool tensors cannot be used.","triggerScenarios":"Calling conv_transpose1d with an input/weight tensor whose dtype is not F32/F64/F16/BF16; upsampling integer-encoded 1D sequences (e.g. token or audio codes) directly.","commonSituations":"Audio/codec decoders (e.g. neural vocoders, EnCodec-style models) where quantized codebook indices feed the transposed-conv decoder without embedding lookup; dtype drift after graph export.","solutions":["Cast the input to a float dtype before conv_transpose1d: x.cast(DType::F32).","For integer codes, run an embedding lookup (or learned codebook projection) to floats before the transposed conv.","Check .dtype() of input and weight right before the call to pinpoint the mismatch source.","Add a support arm in crates/burn-flex/src/ops/module.rs if a new float dtype must be handled."],"exampleFix":"// before\nlet out = conv_transpose1d(code_indices_i64, weight, bias, options);\n// panic: conv_transpose1d: unsupported dtype I64\n\n// after\nlet x = embedding.lookup(code_indices_i64); // float output\nlet out = conv_transpose1d(x, weight, bias, options);","handlingStrategy":"validation","validationCode":"let x = match x.dtype() {\n    DType::F32 | DType::F64 | DType::F16 | DType::BF16 => x,\n    _ => x.cast(DType::F32),\n};\nlet out = conv_transpose1d(x, weight, bias, options);","typeGuard":"fn is_float(t: &Tensor<Flex>) -> bool {\n    matches!(t.dtype(), DType::F32 | DType::F64 | DType::F16 | DType::BF16)\n}","tryCatchPattern":"let out = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| conv_transpose1d(x.clone(), w.clone(), b.clone(), opts.clone())))\n    .unwrap_or_else(|_| conv_transpose1d(x.cast(DType::F32), w, b, opts));","preventionTips":["Route integer codes through an embedding lookup before any transposed conv.","Cast decoder inputs to float immediately after loading stored latents.","Assert decoder input dtype in the module's forward() during tests.","Verify export/import toolchains don't silently change dtypes at decoder boundaries."],"tags":["burn","dtype","panic","conv-transpose","backend"],"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"}