Skip to content

Commit 31baca9

Browse files
authored
replace py3.7 f-string for backward compatibility (#27)
1 parent 4a4138a commit 31baca9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

scripts/cpu/gen-dense-cpu-ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def gen_cpu_ops_shard(self, func_defs, cpp_path, header_path, num_shards=1):
465465
defs_code = ''.join([f['def'] for f in shard])
466466

467467
filename, ext = os.path.splitext(cpp_path)
468-
shard_filepath = f'{filename}_{idx}{ext}'
468+
shard_filepath = '%s_%s%s' % (filename, idx, ext)
469469
shard_content = _CPP_HEADER.format(gen=os.path.basename(sys.argv[0]), funcs=defs_code, regs=regs_code)
470470
write_or_skip(shard_filepath, shard_content)
471471

scripts/cpu/gen-sparse-cpu-ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def gen_cpu_ops_shard(self, func_defs, cpp_path, header_path, num_shards=1):
383383
defs_code = ''.join([f['def'] for f in shard])
384384

385385
filename, ext = os.path.splitext(cpp_path)
386-
shard_filepath = f'{filename}_{idx}{ext}'
386+
shard_filepath = '%s_%s%s' % (filename, idx, ext)
387387
shard_content = _CPP_HEADER.format(gen=os.path.basename(sys.argv[0]), funcs=defs_code, regs=regs_code)
388388
write_or_skip(shard_filepath, shard_content)
389389

0 commit comments

Comments
 (0)