{"record":{"id":"e150492964eb0c64","repo":"huggingface/candle","slug":"unsupported-op-type-op-type-for-op-node","errorCode":null,"errorMessage":"unsupported op_type {op_type} for op {node:?}","messagePattern":"unsupported op_type (.+?) for op (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"candle-onnx/src/eval.rs","lineNumber":2567,"sourceCode":"                                flat_output = flat_output.slice_scatter(\n                                    &update_slice.unsqueeze(0)?,\n                                    0,\n                                    flat_idx,\n                                )?;\n                            } else {\n                                flat_output =\n                                    flat_output.slice_scatter(&update_slice, 0, flat_idx)?;\n                            }\n                        }\n                    }\n                }\n\n                // Reshape flat output back to original shape\n                output = flat_output.reshape(data_shape.to_vec())?;\n\n                values.insert(node.output[0].clone(), output);\n            }\n            op_type => bail!(\"unsupported op_type {op_type} for op {node:?}\"),\n        }\n    }\n    graph\n        .output\n        .iter()\n        .map(|output| match values.remove(&output.name) {\n            None => bail!(\"cannot find output {}\", output.name),\n            Some(value) => Ok((output.name.clone(), value)),\n        })\n        .collect()\n}\n\nfn broadcast_shape(shape_a: &[usize], shape_b: &[usize]) -> Result<Vec<usize>> {\n    let (longest, shortest) = if shape_a.len() > shape_b.len() {\n        (shape_a, shape_b)\n    } else {\n        (shape_b, shape_a)\n    };","sourceCodeStart":2549,"sourceCodeEnd":2585,"githubUrl":"https://github.com/huggingface/candle/blob/d5fee525bfde3273eb7c9b75fd2bc4937be867ca/candle-onnx/src/eval.rs#L2549-L2585","documentation":"simple_eval_ dispatches on node op_type inside a match; the final arm catches any operator type the evaluator does not implement and bails with this message, including the node debug dump. It means the ONNX model uses an operator candle-onnx has no eval support for.","triggerScenarios":"Running any model containing an op_type not covered by the match arms in simple_eval_ (e.g. newer or less common ONNX ops like RandomNormalLike, Loop, If, custom domains).","commonSituations":"Using models with control-flow ops (Loop/If/Scan) or ops added in newer opsets than the evaluator supports; custom-operator domains from framework-specific exporters.","solutions":["Check the listed op_type against candle-onnx's supported ops and implement it in eval.rs","Simplify/export the model avoiding unsupported ops (opset downgrade, operator replacement via onnx-surgement)","Run inference with onnxruntime for models with unsupported ops","Contribute/patch the missing op and rebuild candle-onnx"],"exampleFix":"// eval.rs\nop_type => bail!(\"unsupported op_type {op_type} for op {node:?}\"),\n// after: add an arm\n\"Clip\" => { /* implement clip */ }","handlingStrategy":"try-catch","validationCode":"const SUPPORTED: &[&str] = &[\"Add\",\"Mul\",\"Resize\",\"Trilu\",\"ScatterND\" /* ... */];\nfor node in &graph.node {\n    if !SUPPORTED.contains(&node.op_type.as_str()) {\n        return Err(format!(\"unsupported op: {}\", node.op_type));\n    }\n}","typeGuard":"fn all_ops_supported(graph: &Graph) -> bool {\n    graph.node.iter().all(|n| SUPPORTED.contains(&n.op_type.as_str()))\n}","tryCatchPattern":"match eval(model, inputs) {\n    Err(e) if e.starts_with(\"unsupported op_type\") => run_with_onnxruntime(model, inputs),\n    other => other,\n}","preventionTips":["Audit model opsets against candle-onnx's supported ops list before inference","Avoid control-flow ops (If/Loop/Scan) when targeting candle-onnx","Keep the supported-op list in CI as a lint step"],"tags":["onnx","unsupported-operator"],"backgroundTag":"unsupported-operator-feature","analyzedSha":"d5fee525bfde3273eb7c9b75fd2bc4937be867ca","analyzedAt":"2026-09-02T00:15:47.023Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}