{"record":{"id":"dec27e38bf5f95da","repo":"tracel-ai/burn","slug":"int-cummin-unsupported-dtype","errorCode":null,"errorMessage":"int_cummin: unsupported dtype {:?}","messagePattern":"int_cummin: unsupported dtype (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-flex/src/ops/int.rs","lineNumber":724,"sourceCode":"            DType::U64 => crate::ops::cumulative::cumprod::<u64>(tensor, dim),\n            DType::U32 => crate::ops::cumulative::cumprod::<u32>(tensor, dim),\n            DType::U16 => crate::ops::cumulative::cumprod::<u16>(tensor, dim),\n            DType::U8 => crate::ops::cumulative::cumprod::<u8>(tensor, dim),\n            dt => panic!(\"int_cumprod: unsupported dtype {:?}\", dt),\n        }\n    }\n\n    fn int_cummin(tensor: IntTensor<Flex>, dim: usize) -> IntTensor<Flex> {\n        match tensor.dtype() {\n            DType::I64 => crate::ops::cumulative::cummin::<i64>(tensor, dim),\n            DType::I32 => crate::ops::cumulative::cummin::<i32>(tensor, dim),\n            DType::I16 => crate::ops::cumulative::cummin::<i16>(tensor, dim),\n            DType::I8 => crate::ops::cumulative::cummin::<i8>(tensor, dim),\n            DType::U64 => crate::ops::cumulative::cummin::<u64>(tensor, dim),\n            DType::U32 => crate::ops::cumulative::cummin::<u32>(tensor, dim),\n            DType::U16 => crate::ops::cumulative::cummin::<u16>(tensor, dim),\n            DType::U8 => crate::ops::cumulative::cummin::<u8>(tensor, dim),\n            dt => panic!(\"int_cummin: unsupported dtype {:?}\", dt),\n        }\n    }\n\n    fn int_cummax(tensor: IntTensor<Flex>, dim: usize) -> IntTensor<Flex> {\n        match tensor.dtype() {\n            DType::I64 => crate::ops::cumulative::cummax::<i64>(tensor, dim),\n            DType::I32 => crate::ops::cumulative::cummax::<i32>(tensor, dim),\n            DType::I16 => crate::ops::cumulative::cummax::<i16>(tensor, dim),\n            DType::I8 => crate::ops::cumulative::cummax::<i8>(tensor, dim),\n            DType::U64 => crate::ops::cumulative::cummax::<u64>(tensor, dim),\n            DType::U32 => crate::ops::cumulative::cummax::<u32>(tensor, dim),\n            DType::U16 => crate::ops::cumulative::cummax::<u16>(tensor, dim),\n            DType::U8 => crate::ops::cumulative::cummax::<u8>(tensor, dim),\n            dt => panic!(\"int_cummax: unsupported dtype {:?}\", dt),\n        }\n    }\n\n    fn int_argmax(tensor: IntTensor<Flex>, dim: usize) -> IntTensor<Flex> {","sourceCodeStart":706,"sourceCodeEnd":742,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-flex/src/ops/int.rs#L706-L742","documentation":"int_cummin computes the running minimum along a dimension for each supported integer dtype (I64..U8). The panic fires when the tensor dtype is a non-integer type (float/bool), meaning the wrong tensor kind reached the integer cumulative-min path. Purely a dtype-dispatch guard.","triggerScenarios":"Calling cummin (int_cummin) on a Flex tensor whose dtype is F32/F64/F16/BF16 or Bool.","commonSituations":"Porting code from frameworks where cummin is dtype-agnostic; a prior cast/division produced floats; model checkpoint tensors loaded with float dtype where ints were expected.","solutions":["Assert/verify the tensor dtype is integer before calling cummin; cast to i64/i32 if necessary.","Use a float-specific min/cumulative implementation for float tensors.","Fix upstream dtype-promoting operations with explicit casts.","Log dtypes at module boundaries when porting multi-dtype pipelines."],"exampleFix":"// before\nlet out = t.cummin(dim); // t is BF16 -> panic\n// after\nlet out_i = t.cast::<i32>();\nlet out = out_i.cummin(dim);","handlingStrategy":"validation","validationCode":"assert!(t.dtype().is_int(), \"cummin requires an int tensor, got {:?}\", t.dtype());","typeGuard":"fn is_int_tensor(t: &FlexTensor) -> bool { matches!(t.dtype(), DType::I64 | DType::I32 | DType::I16 | DType::I8 | DType::U64 | DType::U32 | DType::U16 | DType::U8) }","tryCatchPattern":null,"preventionTips":["Cast to i64/i32 before cummin when dtype is uncertain","Use float reductions for float tensors instead of int paths","Log tensor.dtype() when debugging cross-framework ports"],"tags":["rust","burn","dtype","cummin"],"backgroundTag":"unsupported-dtype-for-op","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"}