Skip to content

Commit 822d8df

Browse files
authored
allow removed experimental ops in the checker for now (#1792)
1 parent bfa8b33 commit 822d8df

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

onnx/checker.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,15 @@ void check_node(
319319
") has zero input and zero output.");
320320
}
321321

322+
// Put the removed experimental ops here
323+
if (node.op_type() == "ConstantFill") {
324+
std::cerr << "Warning: " << node.op_type() << " was a removed "
325+
<< " experimental ops. In the future, we may directly "
326+
<< "reject this operator. Please update your model as soon "
327+
<< "as possible.";
328+
return;
329+
}
330+
322331
// Resolve domain for node
323332
const auto& opset_imports = ctx.get_opset_imports();
324333
auto dit = opset_imports.find(node.domain());

onnx/test/checker_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,11 @@ def test_check_tensor_zero_elem(self): # type: () -> None
231231
tensor = self._sample_0_elem_tensor
232232
checker.check_tensor(tensor)
233233

234+
def test_check_removed_experimental_op(self): # type: () -> None
235+
node = helper.make_node(
236+
"ConstantFill", [], ["Y"], name="test", shape=[1, 2])
237+
checker.check_node(node)
238+
234239

235240
if __name__ == '__main__':
236241
unittest.main()

0 commit comments

Comments
 (0)