{"record":{"id":"1b88720dac646e1b","repo":"tracel-ai/burn","slug":"float-cummin-unsupported-dtype","errorCode":null,"errorMessage":"float_cummin: unsupported dtype {:?}","messagePattern":"float_cummin: unsupported dtype (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-flex/src/ops/float.rs","lineNumber":800,"sourceCode":"            }\n            DType::BF16 => {\n                crate::ops::cumulative::cumprod_half(tensor, dim, bf16::to_f32, bf16::from_f32)\n            }\n            _ => panic!(\"float_cumprod: unsupported dtype {:?}\", tensor.dtype()),\n        }\n    }\n\n    fn float_cummin(tensor: FloatTensor<Flex>, dim: usize) -> FloatTensor<Flex> {\n        match tensor.dtype() {\n            DType::F32 => crate::ops::cumulative::cummin_f32(tensor, dim),\n            DType::F64 => crate::ops::cumulative::cummin_f64(tensor, dim),\n            DType::F16 => {\n                crate::ops::cumulative::cummin_half(tensor, dim, f16::to_f32, f16::from_f32)\n            }\n            DType::BF16 => {\n                crate::ops::cumulative::cummin_half(tensor, dim, bf16::to_f32, bf16::from_f32)\n            }\n            _ => panic!(\"float_cummin: unsupported dtype {:?}\", tensor.dtype()),\n        }\n    }\n\n    fn float_cummax(tensor: FloatTensor<Flex>, dim: usize) -> FloatTensor<Flex> {\n        match tensor.dtype() {\n            DType::F32 => crate::ops::cumulative::cummax_f32(tensor, dim),\n            DType::F64 => crate::ops::cumulative::cummax_f64(tensor, dim),\n            DType::F16 => {\n                crate::ops::cumulative::cummax_half(tensor, dim, f16::to_f32, f16::from_f32)\n            }\n            DType::BF16 => {\n                crate::ops::cumulative::cummax_half(tensor, dim, bf16::to_f32, bf16::from_f32)\n            }\n            _ => panic!(\"float_cummax: unsupported dtype {:?}\", tensor.dtype()),\n        }\n    }\n\n    fn float_cast(tensor: FloatTensor<Flex>, dtype: FloatDType) -> FloatTensor<Flex> {","sourceCodeStart":782,"sourceCodeEnd":818,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-flex/src/ops/float.rs#L782-L818","documentation":"float_cummin computes the running minimum; F32/F64 use dedicated f32 kernels and F16/BF16 route through cummin_half with f32 conversion. Other dtypes hit the panic arm. Only float tensors are accepted by this flex-backend op.","triggerScenarios":"Calling Tensor::cummin (running min along a dim) on burn-flex with a tensor whose dtype is not one of the four float dtypes.","commonSituations":"Running-min over integer sequences (e.g. index arrays); generic helpers shared across dtypes where an Int tensor reached the float path; porting torch cummin code that accepted ints.","solutions":["Cast to float before calling cummin: tensor.to_dtype(FloatDType::F32).cummin(dim).","For integer data, consider sort/scan alternatives or implement an int cummin in the backend.","Trace upstream ops to find where the tensor became Int and fix dtype there.","Extend float_cummin with the missing dtype arm if you control the backend."],"exampleFix":"// before\nlet m = idx.cummin(1); // idx: Int -> panic\n// after\nlet m = idx\n    .to_dtype(burn::tensor::FloatDType::F32)\n    .cummin(1);","handlingStrategy":"validation","validationCode":"assert!(matches!(tensor.dtype(), DType::F32 | DType::F64 | DType::F16 | DType::BF16), \"cummin needs a float tensor, got {:?}\", tensor.dtype());","typeGuard":"fn is_float_dtype(dtype: &DType) -> bool { matches!(dtype, DType::F32 | DType::F64 | DType::F16 | DType::BF16) }","tryCatchPattern":"// Guard the call site; panics are not recoverable:\nif is_float_dtype(&tensor.dtype()) { let m = tensor.cummin(dim); }","preventionTips":["Cast integer sequences to float before running min/max scans.","Keep scan helpers generic over Float only, so misuse surfaces at compile time.","Trace dtype provenance when refactoring tensor pipelines.","Verify backend op support before porting dtype-flexible torch code."],"tags":["rust","dtype","panic","burn","cummin"],"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"}