File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed
test/python/onnx_importer Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -742,7 +742,7 @@ def _sanitize_name(self, name):
742742
743743 # Remove characters that are invalid in MLIR identifier names.
744744 # https://mlir.llvm.org/docs/LangRef/#identifiers-and-keywords
745- return re .sub ("[:/- ]" , "_" , name )
745+ return re .sub ("[^\w\. ]" , "_" , name )
746746
747747 def tensor_proto_to_attr (self , tp : onnx .TensorProto ) -> Attribute :
748748 tensor_type = self .tensor_proto_to_builtin_type (tp )
Original file line number Diff line number Diff line change 1+ # The original constant name : "abz_.(1, 2)[$something, %anotherthing]"
2+
3+ # RUN: %PYTHON -m torch_mlir.tools.import_onnx %S/BadName.onnx | FileCheck %s
4+
5+ # CHECK: torch.operator "onnx.Constant"() {torch.onnx.value = dense_resource<_abz_._1__2___something___anotherthing_>
You can’t perform that action at this time.
0 commit comments