diff --git a/projects/rocprofiler-compute/src/utils/utils.py b/projects/rocprofiler-compute/src/utils/utils.py index 71ec26edfb..3d652256b1 100644 --- a/projects/rocprofiler-compute/src/utils/utils.py +++ b/projects/rocprofiler-compute/src/utils/utils.py @@ -492,9 +492,13 @@ def flatten_tcc_info_across_hbm_stacks(file, stack_num, tcc_channel_per_stack): for col in tcc_cols_orig: for i in range(0, stack_num): # filter the channel index only - p = re.compile(r"(\d+)") + p = re.compile(r"\[(\d+)\]") # pick up the 1st element only - r = lambda match: str(int(float(match.group(0))) + i * tcc_channel_per_stack) + r = ( + lambda match: "[" + + str(int(match.group(1)) + i * tcc_channel_per_stack) + + "]" + ) tcc_cols_in_group[i].append(re.sub(pattern=p, repl=r, string=col)) for i in range(0, stack_num):