已合并
fix SyntaxWarning: invalid escape sequence '$' and '\w' #1497
hehongan创建于 4月9日
fix SyntaxWarning: invalid escape sequence '$' and '\w' #1497
已合并
hehongan创建于 4月9日
3 个文件变更+3-3
@@ -169,7 +169,7 @@ def get_kernel_source(src_file, dir_snake, dir_ex):
169 169 
170'''170'''
171 171 
172-IMPL_API = '''172+IMPL_API = r'''
173@tbe_register.register_operator("{}", trans_bool_to_s8=False)173@tbe_register.register_operator("{}", trans_bool_to_s8=False)
174@para_check.check_op_params({})174@para_check.check_op_params({})
175def {}({}, kernel_name="{}"{}):175def {}({}, kernel_name="{}"{}):
@@ -176,7 +176,7 @@ def skip_mc2_context_size(opinfo: OpInfo):
176def match_options(options, compile_options):176def match_options(options, compile_options):
177 result = []177 result = []
178 for option in options:178 for option in options:
179- match = re.search(f'{option}=(\w+)', ' '.join(compile_options))179+ match = re.search(rf'{option}=(\w+)', ' '.join(compile_options))
180 if match:180 if match:
181 result.append(match.group(1))181 result.append(match.group(1))
182 else:182 else:
@@ -176,7 +176,7 @@ def skip_mc2_context_size(opinfo: OpInfo):
176def match_options(options, compile_options):176def match_options(options, compile_options):
177 result = []177 result = []
178 for option in options:178 for option in options:
179- match = re.search(f'{option}=(\w+)', ' '.join(compile_options))179+ match = re.search(rf'{option}=(\w+)', ' '.join(compile_options))
180 if match:180 if match:
181 result.append(match.group(1))181 result.append(match.group(1))
182 else:182 else: