diff --git a/scripts/cpu/gen-dense-cpu-ops.py b/scripts/cpu/gen-dense-cpu-ops.py index dce834882..3480a7e70 100755 --- a/scripts/cpu/gen-dense-cpu-ops.py +++ b/scripts/cpu/gen-dense-cpu-ops.py @@ -465,7 +465,7 @@ def gen_cpu_ops_shard(self, func_defs, cpp_path, header_path, num_shards=1): defs_code = ''.join([f['def'] for f in shard]) filename, ext = os.path.splitext(cpp_path) - shard_filepath = f'{filename}_{idx}{ext}' + shard_filepath = '%s_%s%s' % (filename, idx, ext) shard_content = _CPP_HEADER.format(gen=os.path.basename(sys.argv[0]), funcs=defs_code, regs=regs_code) write_or_skip(shard_filepath, shard_content) diff --git a/scripts/cpu/gen-sparse-cpu-ops.py b/scripts/cpu/gen-sparse-cpu-ops.py index e09941a9b..c3c67edd7 100755 --- a/scripts/cpu/gen-sparse-cpu-ops.py +++ b/scripts/cpu/gen-sparse-cpu-ops.py @@ -383,7 +383,7 @@ def gen_cpu_ops_shard(self, func_defs, cpp_path, header_path, num_shards=1): defs_code = ''.join([f['def'] for f in shard]) filename, ext = os.path.splitext(cpp_path) - shard_filepath = f'{filename}_{idx}{ext}' + shard_filepath = '%s_%s%s' % (filename, idx, ext) shard_content = _CPP_HEADER.format(gen=os.path.basename(sys.argv[0]), funcs=defs_code, regs=regs_code) write_or_skip(shard_filepath, shard_content)