{"record":{"id":"1d14d949e103e7d4","repo":"deeplearning4j/deeplearning4j","slug":"no-onnx-op-opname-found-for-setrange","errorCode":null,"errorMessage":"No onnx op opName found for setrange","messagePattern":"No onnx op opName found for setrange","errorType":"exception","errorClass":"NoOpNameFoundException","httpStatus":null,"severity":"error","filePath":"nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/impl/transforms/strict/SetRange.java","lineNumber":72,"sourceCode":"    public SetRange(INDArray x, double min, double max) {\n        super(x);\n        this.min = min;\n        this.max = max;\n        this.extraArgs = new Object[] {min, max};\n    }\n\n    @Override\n    public int opNum() {\n        return 25;\n    }\n\n    @Override\n    public String opName() {\n        return \"setrange\";\n    }\n    @Override\n    public String onnxName() {\n        throw new NoOpNameFoundException(\"No onnx op opName found for \" +  opName());\n    }\n\n    @Override\n    public String tensorflowName() {\n        throw new NoOpNameFoundException(\"No tensorflow op opName found for \" +  opName());\n    }\n\n    @Override\n    public List<SDVariable> doDiff(List<SDVariable> f1) {\n        return null;\n    }\n}\n","sourceCodeStart":54,"sourceCodeEnd":85,"githubUrl":"https://github.com/deeplearning4j/deeplearning4j/blob/4c22ac5fe4a8350d05d224e7f4499429f7f69c93/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/impl/transforms/strict/SetRange.java#L54-L85","documentation":"SetRange has no ONNX operator equivalent, so onnxName() throws NoOpNameFoundException for opName() \"setrange\". ND4J throws this whenever framework name resolution finds no registered mapping for the op.","triggerScenarios":"Calling SetRange.onnxName(); exporting a SameDiff graph containing a SetRange node to ONNX; ONNX export tooling enumerating all ops in the graph.","commonSituations":"ONNX conversion of models using setrange-style range-clamping transforms; custom activation pipelines built on SetRange then exported.","solutions":["Replace SetRange with an ONNX-representable equivalent (e.g. clip/min+max composition)","Express the range operation from primitive ONNX ops before export","Catch NoOpNameFoundException during export and substitute or drop the node","Add a custom op mapping/subclass overriding onnxName() if your exporter supports it"],"exampleFix":"// before\nSDVariable y = sd.math.setRange(x, min, max);\n// after\nSDVariable y = sd.math.clip(x, min, max); // clip-by-value, ONNX-mappable","handlingStrategy":"try-catch","validationCode":"try { new SetRange().onnxName(); return true; } catch (NoOpNameFoundException e) { return false; } // use clip instead","typeGuard":"static boolean onnxExportable(Op op) {\n    try { op.onnxName(); return true; } catch (NoOpNameFoundException e) { return false; }\n}","tryCatchPattern":"try {\n    exporter.addOp(op, op.onnxName());\n} catch (NoOpNameFoundException e) {\n    exporter.addOp(clipByValueRewrite(op)); // min(max(x,min),max)\n}","preventionTips":["Replace SetRange with clip/min/max compositions by default — they export everywhere","Run an onnxName() support scan over graphs before export","Avoid ND4J-specific transform ops when building cross-framework models","Document internal activation choices with their framework-mapping status"],"tags":["nd4j","onnx","samediff","op-mapping"],"backgroundTag":"unsupported-operation","analyzedSha":"4c22ac5fe4a8350d05d224e7f4499429f7f69c93","analyzedAt":"2026-09-07T05:27:04.714Z","contentChangedAt":"2026-09-07T05:27:04.714Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}