Skip to content

Commit 1375be3

Browse files
committed
refactor(python_ffi): 前端控制算子类型是否添加 onnx:: 前缀以便自定义算子
Signed-off-by: YdrMaster <[email protected]>
1 parent 41036a0 commit 1375be3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/09python_ffi/src/import.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ namespace refactor::python_ffi {
6565
ctx_.insert({std::move(name), {std::move(value)}});
6666
}
6767
return std::make_shared<OpBox>(Operator::build(
68-
ctx_, fmt::format("onnx::{}", opType), std::move(attrs_)));
68+
ctx_, std::move(opType), std::move(attrs_)));
6969
}
7070

7171
Arc<Compiler>

src/09python_ffi/src/refactor_graph/onnx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def make_compiler(model: ModelProto, external_data_path: str = "") -> Compiler:
6363
{
6464
node.name: _make_operator(
6565
context,
66-
node.op_type,
66+
"onnx::" + node.op_type,
6767
_parse_attribute(node, external_data_path),
6868
)
6969
for node in model.graph.node

0 commit comments

Comments
 (0)