Skip to content

Commit 72f6da0

Browse files
ManewingFlorian Walbroel
andauthored
python/torch_mlir/extras/onnx_importer.py: fix: SyntaxWarning: invalid escape sequence '\w' (#4296)
Mark raw string to avoid syntax warning Co-authored-by: Florian Walbroel <[email protected]>
1 parent 7000187 commit 72f6da0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/torch_mlir/extras/onnx_importer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ def _sanitize_name(self, name):
745745

746746
# Remove characters that are invalid in MLIR identifier names.
747747
# https://mlir.llvm.org/docs/LangRef/#identifiers-and-keywords
748-
return re.sub("[^\w\.]", "_", name)
748+
return re.sub(r"[^\w\.]", "_", name)
749749

750750
def tensor_proto_to_attr(self, tp: onnx.TensorProto) -> Attribute:
751751
tensor_type = self.tensor_proto_to_builtin_type(tp)

0 commit comments

Comments
 (0)